xml

How to parse badly formed XML in Java?

I have XML that I need to parse but have no control over the creation of. Unfortunately it's not very strict XML and contains things like: <mytag>This won't parse & contains an ampersand.</mytag> The javax.xml.stream classes don't like this at all, and rightly error with: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[...

Hibernate second-level cache in orm.xml?

Hello, Having been googling for hours, I realize that users can use either xml file(orm.xml, I suppose?) or annotations in JPA, or both of them at the same time. I'm i correct? So, My project use the second-level cache, which is not in the JPA specification. And I use annotations like: @org.hibernate.annotations.Cache(usage = org.hibern...

Reading multiple xml documents from a socket in java

I'm writing a client which needs to read multiple consecutive small XML documents over a socket. I can assume that the encoding is always UTF-8 and that there is optionally delimiting whitespace between documents. The documents should ultimately go into DOM objects. What is the best way to accomplish this? The essense of the problem i...

linq to xml with C# and VS2008

XML Formatted <status> <webresponse> <properties> <props> <imghandle> <image handle=1234> <imagetag>somewhere</imagetag> </image> </imghandle> </props> <props> <imghandle> <image handle=1235> <imagetag>somewhere1</imagetag> </image> </imghandle> </props> </properties> </w...

Is the XML declaration tag case sensitive?

I have what is probably a really simple, studid question but I can't find an answer to it anywhere and I need to be pretty sure about this. I have various XML files from various vendors. One of the vendors provide me an XML file with japanese characters in the file. Originally, I was having trouble processing the XML file (I'm using the...

Effective way to transform a few nodes contents of feeds

Dear all I need to "proxy" a feed and leave most of the nodes unspoiled and transform the content of a few known nodes by calling some java methods and return the transformed feed Of course I prefer to avoid - loading in memory the whole feed - transform other nodes - bad performance It's a kind of java pipe ! Thanks for your re...

How to determine Attributes count for XML documents using C#

Hi all, I'm using XmlReader and xml navigator as following: XmlDocument doc = new XmlDocument(); doc.Load(txtFileName.Text.Trim()); // Create the navigator. XPathNavigator xnav = doc.CreateNavigator(); Once you created the navigation you can select the descendant or children and you can determine the number of childrens. However, i ...

E4X: grab nodes with namespaces?

I want to learn how to process XML with namespaces in E4X so basically here is what I want to learn, say I have some XML like this: <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/"&gt; <rdf:item value="5"/> <item value="10"/> </rdf:RDF> How could I assign < rdf:item /> to a v...

How do I convert WebService result typed as ObjectProxy to XML?

I have a WebService that returns XML in a SOAP response: <?xml version="1.0" encoding="utf-8" ?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; <soap:Body> <GetConfigResponse xmlns="Web.Services"> ...

output xml with attributes

Hello, How do I get this output? <MSRP currency="USD">10.00</MSRP> writer.WriteElementString("MSRP", Convert.ToString(q.ItemPrice1)); writer.WriteAttributeString("currency", "MSRP", "USD"); this is the error: Token StartAttribute in state Content would result in an invalid XML document. ...

How do I parse an NSString containing XML in Objective-C?

In my iPhone application, I have the following NSString: NSString *myxml=@"<students> <student><name>Raju</name><age>25</age><address>abcd</address> </student></students>"; How would I parse the XML content of this string? ...

Difference between XPATH, XQuery and Xpointer

What is the difference between XPath, Xquery and Xpointer? As far as my knowledge, xquery is extended version of Xpath. I have the basic knowledge of XPath. Is there any feature available in XPAth which is not in XQuery. Yesterday, i heard a new word "Xpointer". I am confused. Which product is used for which purpose. ...

Is there any use for putting a string that contains enters (char 10 or 13) in a xml CDATA section?

I'm currently working on some old code that has the following construct. Document doc = org.w3c.Document Element root = doc.getDocumentElement(); if ( string contains \n or \r ) then root.appendChild(doc.createCDATASection(string)) else root.appendChild(doc.createTextNode(string)) endif I can not think of any usage that would nee...

how to reference XSD Schema location while parsing XML Doc via SAX Xerces?

how to reference XSD Schema location while parsing XML via SAX Xerces? < ?xml version="1.0" encoding="ISO-8859-1"?> < com.firma xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > < !-- xsi:noNamespaceSchemaLocation="F:\...\myschema_v2.5.xsd" Must I reference this element really within the XML Doc??? I hope, not... ...

Parsing Media RSS using XMLReader

<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/"&gt; <channel> <title>Title of RSS feed</title> <link>http://www.google.com&lt;/link&gt; <description>Details about the feed</description> <pubDate>Mon, 24 Nov 08 21:44:21 -0500</pubDate> <language>en</language> <it...

Creating link in dataGrid

<mx:DataGrid visible="false" id="dgPosts" width="365" click="" dataProvider="{sendReq.lastResult.loginsuccess.name}" x="140.5" y="169"> <mx:columns> <mx:DataGridColumn headerText="name" dataField="name"/> </mx:columns> </mx:DataGrid> When i click on a particular dataItem, the corresponding w...

X509Certificate encryption/decryption

I'm just starting to learn XML security. We have VS-2005 & ASP.Net 2.0. I want to send XML to a outside URL and it needs to be encrypted. I'm doing exactly what the MSDN articles ms229744 & ms229943 are doing, but when doing the DecryptDocument() method, I keep getting the "Unable to retrieve the decryption key." I'm using our SSL web ce...

Problem with StringBuilder and XML Literals

I'm having a problem using XML literals with a StringBuilder in VB 2008. If I use this code everything is fine. Dim html As New System.Text.StringBuilder html.Append(<html><body></body></html>) MsgBox("hello") Now the problem is I want to wrap HTML around something that is generated in code. html.Append(<html><body>) msgbox("nothi...

XmlSlurper - list text and regular nodes of xhtml document

I am using Groovy's XmlSlurper to parse xhtml document (or sudo xhthml one), and I'm trying to get to the text nodes of the document but can't figure how, here is the code: import groovy.util.* xmlText = ''' <TEXTFORMAT INDENT="10" LEADING="-5"> <P ALIGN="LEFT"> <FONT FACE="Garamond Premr Pro" SIZE="20" COLOR="#001200" LETTERSPA...

Creating an Open XML file in .NET - schema

I'm trying to make a report generator inside of a C# application for my boss, I came across this page and looked into RichTextBoxes and think that I can build on this idea to do what my boss is looking for. http://openxmldeveloper.org/articles/OpenXMLDocFromDotNet.aspx The issue I'm running into is their example code for the XML portion...