xml

How to render a self closing HTML tag with attributes in XSLT??

Well I want to render a self closing tag say <img> tag like this <img src="xyz.jpg" /> But I don't know how to do that...I mean how to render a self closing tag. What I'm having so far is below:- Here is the XML: <c:Image src="xyz.jpg"></c:Image> And here is the XSLT: <xsl:output indent="yes" omit-xml-declaration="yes" method="ht...

Prepending some text to a WCF response message body

I want to prepend the following text to the response body of a WCF operation: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="transform.xslt" type="text/xsl" ?> What is the best way to do this? An additional requirement is that the XSLT filename should be spec'd using an attribute on the operation method. I am trying t...

Can anyone tell me in detail about xmlHashScan function in the libxml2 library?

Can anyone tell me in detail about xmlHashScan function in the libxml2 library? ...

PHP DomDocument XML Load with Broken XML Data

Hi, How do you deal with broken data in XML files? For example, if I had <text>Some &improper; text here.</text> I'm trying to do: $doc = new DOMDocument(); $doc->validateOnParse = false; $doc->formatOutput = false; $doc->load(...xml'); and it fails miserably, because there's an unknown entity. Note, I can't use CDATA due to t...

Java Remove empty XML tags

I'm looking for a simple Java snippet to remove empty tags from a (any) XML structure <xml> <field1>bla</field1> <field2></field2> <field3/> <structure1> <field4>bla</field4> <field5></field5> <structure1> </xml> should turn into; <xml> <field1>bla</field1> <structure1> <field4>bla</fi...

XML and XSLT and setting namespace.

I need to add an xmlns to the root element in the output of this XSLT transform. I've tried added <xsl:attribute name="xmlns"> but it's disallowed. Has anyone got any ideas how I could solve this? <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:template match="/"> <xsl:variable name="roo...

selecting one value out of an xml column

I have a particularly troublesome xml column to query data from. The schema is fixed by the Quebec Ministry of Revenue so "it is what it is" The important part of the query looks like this: with XMLNAMESPACES(default 'http://www.mrq.gouv.qc.ca/T5') select xmldata.value('(//Groupe02/*/Montants/B_PrestREER_FERR_RPDB)[1]', 'decimal(16,2)...

parse XML string .net

I have the following XML string that I need to parse(break). Any body know what is the code to be used? I can provide my code if need it. <?xml version='1.0' encoding='ISO-8859-1'?> <SystemGenerator-Document> <TN>42</TN> <OC>CR</OC> <HN>738</HN> <USERID>xxx</USERID> <WS>FACTORY</WS> <OBJID>254209</OBJID> <Sys...

XML Parse .net c#

Hi, I am new to XML I am receiving the following file/string. How can I break it in C# so I can put each of the fields in my SQL server Database? BTW I don't know how to format XML in StackOverflow if somebody can tell me how to do it. I'll do it. <?xml version='1.0' encoding='ISO-8859-1'?> <SystemGenerator-Document> <TN>42</TN> ...

Validating against generated xsd files in Visual Studio

I have around twenty XML files in various Visual Studio 2008 projects, each of which both defines certain objects and refers to objects in the file and other files. e.g. <some_object name="a" /> <some_object name="b"><refers_to ref="a" /></some_object> Files refer to other files using custom <include file="blah.xml" /> elements, rathe...

XmlDocument Helper methods

I'm having to use .NET 2.0 so can't use any of the nice XDocument stuff. I'm wondering if anyone has seen any helper/utility methods that still use XmlDocument but make xml creation a bit less tedious? ...

How to Deserialise Xml into a Dictionary<int,string> object?

Is it possible to Deserialize the following piece of XML into a Dictionary<int,string> object? XML: <Config> <DatabaseConnections> <Connection Name="Source Connection" Value="ConnectionStringValue" /> <Connection Name="Target Connection" Value="ConnectionStringValue" /> <DatabaseConnections> <Config> I have a class which ...

Localization of HTML documents?

XML documents can be localized by referring to an external DTD document that contains the translations. For example in Mozilla XULRunner it looks like this: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <!DOCTYPE window SYSTEM "chrome://configpanel/locale/configpanel.dtd"> <window title="&CONFIG_P...

How can you select a node that's an unknown number of levels deep from a tag in XPath?

Example, if I have <form name="blah"> <input name="1"/> <input name="2"/> <table> <tr> <td> <unkown number of levels more> <input name="3"/> </td> </tr> <table> </form> How can I put together a query that will return input 1,2 and 3? Edit: I should note I'm not interested i...

Coldfusion XMLFormat() not converting all characters

I am using XMLFormat() to encode some text for an XML document. However, when I go to read the XML file I created I get an invalid character error. Why does XMLFormat() not properly encode all characters? I'm running CF8. ...

Basic LINQ syntax

Lets say you have an XML like like this: <data> <messages> <message name="Person" id="P"> <field name="FirstName" required="Y" /> <field name="LastName" required="Y" /> <field name="Sex" required="N" /> </message> <message name="Car" id="C"> <field name="Make" required="Y" /> <field name="Model" required=...

XSLT transformations on very large files

We are using XSLT to generate reports of our data. The data is currently stored in Oracle as XML documents (not using the XML type, but normal CLOB). We select the right XML documents and create a single document: <DATABASE> <XMLDOCUMENT> ... </XMLDOCUMENT> <XMLDOCUMENT> ... </XMLDOCUMENT> ... </DATABASE> In some cases, the c...

Does anyone know of an XSL library for creating Excel files?

I would like to use XSL to create excel .xml files that Excel 2003 can open. Does anyone know of a XSL template library that I can use for the purpose? ...

What impact does the Z Index number have in an RDLC file?

I have been creating rdlc reports from scratch using C# to write xml files. To make sure I do this properly I look at the XML behind other reports I created using the VS 2008 report designer feature. When I look at the XML for the reports created using VS, I see the field called ZIndex which as a integer value associated with it. What...

findViewById() returns null for custom component in layout XML, not for other components

I have a res/layout/main.xml including these elements and others: <some.package.MyCustomView android:id="@+id/foo" (some other params) /> <TextView android:id="@+id/boring" (some other params) /> In my Activity's onCreate, I do this: setContentView(R.layout.main); (TextView) boring = findViewById(R.id.boring); // ...find other elemen...