xml

NSXMLDocumentTidyHTML doesn't tidy some XHTML validation errors.

I want to grab text from a list of web pages. I've done a bit of experimenting and found that the best way for my needs is via WebKit. Once the source of the page has been grabbed, I want to strip out all the HTML tags, by using the technique in this comment. Here's my code: - (void)webView:(WebView *)sender didFinishLoadForFrame:(Web...

What libraries are there for processing XML on Google App Engine/Java Servlet

I'm writing a Java servlet in Eclipse (to be hosted on Google App Engine) and need to process an XML document. What libraries are available that are easy to add to an Eclipse project and have good example code? ...

How to change XML based on regex matches to text (character data)

I am trying to match the text contents(character data) of an XML file with a series of regexs and then change the XML based on the matches. Example: <text> <para>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </para> </text> I want to match for instance ...

How to embed an XML loading .swf with a dynamic link

I could barely find a reasonable title that would explain my issue, let alone try and search for how to fix this. My issue : 1) User uploads a .zip with say: flash.swf images.xml image.jpgs 2) It gets extracted into a unique folder ID ex. /swfs/123456/ 3) Server tries to load the .swf in "index.php" and the .swf tries t...

Iterate all XML node generations in java DOM

I want to check to see if an XML document contains a 'person' element anywhere inside. I can check all the first-generation elements very simply: NodeList nodeList = root.getChildNodes(); for(int i=0; i<nodeList.getLength(); i++){ Node childNode = nodeList.item(i); if (childNode.getNodeName() == "person") { //do something with ...

How can I create a Word document using Python?

I'd like to create a Word document using Python, however, I want to re-use as much of my existing document-creation code as possible. I am currently using an XSLT to generate an HTML file that I programatically convert to a PDF file. However, my client is now requesting that the same document be made available in Word (.doc) format. S...

How do you structure a Soaplib class for xml list inputs?

I want to receive XML in this format using Soaplib: <container> <item> <var1>foo</var1> <var2>foo</var2> <var3>foo</var3> </item> <item> <var1>foo</var1> <var2>foo</var2> <var3>foo</var3> </item> <item> <var1>foo</var1> <var2>foo</var2> <var3>f...

Is my use of XMLin killing my remote Asterisk AGI script?

Hi, I'm facing a strange problem while using XML::Simple module of Perl. I am writing an Asterisk AGI script in Perl where I am calling a function someSub() which uses curl to fetch XML from a CGI page into a variable $xmlstream. I then use XMLin on $xmlstream. The code is something as shown below: $xmlstream = someSub() ; #uses curl...

XULRunner: Prevent links to arbitrary domains

Hi, suppose, we have a Mozilla Prism like XULRunner app. There is a XUL window with a <browser/> element, where the browser shows a web page on a given domain (say, example.com). Now there are several links on example.com. If a user follows a local link (i.e., stays on example.com) she should be allowed to follow. If on the other hand ...

Effort estimation: using C / Win32 or learning C# / .NET

I intend to write a small application to scratch a personal itch and probably make the life of some colleagues easier. Here is what I have: 10+ years of experience in C Plenty of experience in programming against the Win16/32 API in C from the Win3.1 to 2000 days. C library written by myself already doing about 75% of what the applicat...

Secure XML Parsers

In typical Java applications, the XML parsers is XALAN/XERCES but they were not written with security in mind. I am curious to know if there are parsers that are more robust when it comes to security. ...

Rewriting Binary Streams using Java

I have been studying Netty and Mina but am confused as to the best way to rewrite binary streams. For example, I would like to create a proxy that will allow for replacement of XML and forward along. Examples appreciated. ...

What causes my XML to break?

I have the following XML code. <firstname> <default length="6">Örwin</default> <short>Örwin</short> <shorter>Örwin</shorter> <shortest>�.</shortest> </firstname> Why does the content of the "shortest" node break? It should be a simple "Ö" instead of the tedious �. XML is UTF-8 encoded and the function which processes the output of...

Storing XML in Active Directory

Is it wise to store XML in Active Directory? In my project an ECM is performing a night-job and is iterating through AD and is reading XML data from each AD group.... ...

Show items by category xml

I have an xml output like this: <data> <item-types> <entry id="1" items="5"> <category>Frozen</category> </entry> <entry id="2" items="4"> <category>Breakfast</category> </entry> </item-types> <items> <entry id="28"> <item-number>1115</item-number> ...

Custom SiteMapProvider derived from XMLSiteMapProvider : How to load an xml document directly in BuildSiteMap()

We have a requirement to load a different XML sitemap for each user that logs in. This sitemap can come from a variety of sources (webservice, database, file) and has to be loaded at runtime. I have designed it thus: When a user logs in, the custom XML for that user is fetched and put into Session. In the BuildSiteMap() method of my cus...

How do I ensure the British Pound Sterling Sign (£) appears correctly?

I have a PHP script that reads in data from an XML file, returns it via AJAX to a page which then places the data in to the relevant text area. The Content-Type of the page is as follows: <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> The XML heading looks like this: <?xml version="1.0" encoding="UTF-8"?> <!D...

Reference to undeclared entity 'nbsp' - why?

I have the following line of code: XDocument formConfiguration = XDocument.Load(ConfigurationManager.AppSettings["XMLFileURL"]); I get the following exception message: Reference to undeclared entity 'nbsp' There are no   sequences in the XML. There are no "&" characters in the XML. Where could this be coming from? Thanks, Char...

C# Linq to XML check if element exists

I have an XML document as follows: <Database> <SMS> <Number>"+447528349828"</Number> <Date>"09/06/24</Date> <Time>13:35:01"</Time> <Message>"Stop"</Message> </SMS> <SMS> <Number>"+447528349828"</Number> <Date>"09/06/24</Date> <Time>13:35:01"</Time> <Message>"Stop"</Message> </SMS> </Database> I am t...

XML file interpretation and manipulations

<?xml version="1.0" encoding="utf-8" ?> <root> <MyData> <MyField>SomeValueHere1</MyField> <MyComplexData> <MyComplexDataField1 property="1"></MyComplexDataField1> <MyComplexDataField2 someproperty"value1"> value1 </MyComplexDataField1> </MyComplexData> </MyData> <MyData> <MyField>SomeValueHere11</MyField...