xml

Problem with simpleXML and entity not being defined

I'm trying to parse a XML file, but when loading it simpleXML prints the following warning: Warning: simplexml_load_file() [function.simplexml-load-file]: gpr_545.xml:55: parser error : Entity 'Oslash' not defined in import.php on line 35 This is that line: <forenames>B&Oslash;IE</forenames><x> </x> As it is a warning, I might ignor...

Appending multiple xml files to a single output using xsl-fo

Hi, I'm creating a PostScript file from XML input using xsl-fo (Apache-FOP). I need also to append multiple such XML to a single PS file. 1. Does Apache-FOP support appending to output? 2. if not, is there away around this issue? (concatenating the XMLs is not an option). Thanks in advance ...

Spring not finding Hibernate mappings file.

Hey guys, So I am taking Enunciate for a spin and have run into an issue when my servlet starts up. For some reason, despite the file being there, in the classpath, and everything being specified correctly, Spring tells me the following: 09-15@15:36:31 ERROR org.springframework.web.context.ContextLoader - Context initialization failed ...

How to send XML data through socket InputStream

Hi, I'm trying to write a client-server application in Java with an XML-based protocol. But I have a great problem! See this part of client code: InputStream incoming = skt.getInputStream(); //I get Stream from Socket. OutputStream out = skt.getOutputStream(); [...] XMLSerializer serializer = new XMLSerializer(); //This create an XML...

Encoding issues with python's etree.tostring

I'm using python 2.6.2's xml.etree.cElementTree to create an xml document: import xml.etree.cElementTree as etree elem = etree.Element('tag') elem.text = (u"Würth Elektronik Midcom").encode('utf-8') xml = etree.tostring(elem,encoding='UTF-8') At the end of the day, xml looks like: <?xml version='1.0' encoding='UTF-8'?> <tag>W&#195;&#...

How do I marshal a JAXB object to XOM?

I'm trying to figure out what bits I need to plug together to marshal a JAXB POJO to a XOM document, and vice versa. The JAXB Marshaller interface's marshal methods take various targets, such as Result, but none of them have a XOM adapter. Irritatingly, the XOM API does have a XOMResult implementation, but it's package protected, and on...

Convert locale to language/country using XSL

I need to figure out the best way to convert locale strings to a human-friendly name. I could write a large <xsl:choose> and just add a condition for each of the locales I want to convert, but I think there is probably a more efficient or clever way. My input looks like this: <content name="locale" value="en_US" /> <content name="local...

Compare/contrast HTML, XHTML, XML, and HTML5

Ok, so I'm not quite sure the difference between these languages. Could someone clarify? I know that XML has user-defined tag and html is pre-defined, but thats basically the extent of my knowledge. I know that HTML5 is supposed to replace HTML, but wasn't XML supposed to do that as well? Basically, which languages here are a substit...

SQL Server XML output with CDATA

Is there a way to have an SQL Server XML return use CDATA? I have XML being returned by SQL Server like this: <locations> <site id="124"> <sitename>Texas A &amp; M</sitename> </site> </locations> When I am required to have this: <locations> <site id="124"> <sitename><![CDATA[Texas A & M]]></sitename> <...

jQuery plugin that deserializes XML?

Is there an XML deserializer for javascript? Preferably in the form of a jQuery plugin. ...

Error in query with XML data type

Hi, I have a query that strips data from a XML string, inserts it into a table variable and queries it to insert the data into another table. It runs like a charm in my localhost environment, but not in my production SQL Server database. The error message is "INSERT failed because the following SET options have incorrect settings: 'ARITH...

How do I test XML equality in Ruby?

Clearly I need to (a) convert both strings to canonical XML or (b) compare their parse-trees. The following doesn't work because the document object returned doesn't have a sensible == defined. Nokogiri.XML(doc_a) == Nokogiri.XML(doc_b) Nor does the following, because Nokogiri's to_xml leaves some internal whitespace: Nokogiri.XML(d...

Localization approach for XSLT + RESX in ASP.NET

I have an ASP.NET web app where the back end data (XML format) is transformed using XSLT, producing XHTML which is output into the page. Simplified code: XmlDocument xmlDoc = MyRepository.RetrieveXmlData(keyValue); XslCompiledTransform xsl = new XslCompiledTransform(); xsl.Load(pathToXsl, XsltSettings.TrustedXslt, null); StringWriter s...

Passing a URL in a XML file for XSLTransformation in C#

My XSL file contains a line like this. Click <a href="<xsl:value-of select=""/ROOT/QUERYSTRING""/>"> here </a> to continue... The value "/ROOT/QUERYSTRING" is populated from a XML which would be any arbitrary URL. But when I run the transformation, it's throwing an XSLT Compile Error at the line, href = "<xsl stating, "< is unexpected...

Using attributes to specify element structure in XSD

I would like to specify the structure of underlying child elements based upon an xml attribute value. For example: <param type="uniform"> <high>10</high> <low>0</low> </param> <param2 type="normal"> <mean>5</mean> <stdev>2.5</mean> <param2> Is there a way to validate this type of structure using XSD? ...

Two xml in one xslt

Hi can i do this in a xslt , and if yes then how..? I have one xml file which contains one element called 'reasonCode' , this reason code is mapped to different 'reasonText' in another xml.What i hae to do is check the 'reasonCode' from first xml and select the corresponding 'reasonText' from second xml.Can i do this using XSLT...if yes ...

is it possible to parse text like XML in GWT ?

I know that browsers do support XML with DOM approach I have an application that uses GWT and it uploads file at the server, when the uploading completes, i need the server to respond back to the client with a Bean since this is a file upload, the response is handled by a servlet. I am able to read a string at the client by reading the...

Append node to an existing xml-Java

I have seen the same question being answered for vb and c#, but i need a Java best solution for appending nodes to an xml. Will xpath help? I have <A> <B> <c>1<c/> <d>2<d/> <e>3<e/> </B> <B> <c>1<c/> <d>2<d/> <e>3<e/> </B> </A> Need to append another <B> <c>11<c/> <d>21<d/> <e>31<e/> </B> ...

XSD any element validation error with CDATA

I have an XSD with an any-element (<xs:any/>) When I create an instance of this XSD and place a CDATA section in it, I get validation errors. I also tried with attributes like: minOccurs="0" maxOccurs="unbounded" processContents="skip" I use XmlSpy for schema validation. ...

Accessing Plist items in a dict

I have a class in a module I that reads a plist (XML) file and returns a dict. This is extremely convenient because I can say something like: Data.ServerNow.Property().DefaultChart This returns a property dictionary, specifically the value for DefaultChart. Very elegant. However, assembling a dictionary this way fails: dict={'Data': ...