xml

How can I search and replace XML based on values in a Perl hash?

I have an XML file in a string variable ($data), and a hash containing all the tag names and their contents (%field_list). The tag names are to be checked so that if they are enumerated fields, their contents should be replaced with strings. Does anybody know if it is possible to do this with search and replace? I am not having much lu...

Implicit conversion from void to XmlDocument

Probably a stupid question, but I'm quite new to the whole "get-and-set-property"-kind of programming; I keep getting a compiling-error on this part of my code; private string _File = "Session.xml"; private XmlDocument XmlDoc { get { XmlDocument _Doc = new XmlDocument(); return _Doc.LoadXml(_File); } } pri...

While Parsing through XML file using SAX, How can I create object of module which is equivalent to element value ?

I have different modules like Author.pm, BillingPeriod.pm, Offer.pm,PaymentMethod.pm etc. now in sax whenever I hit the end element tag I want to create object of module which is equivalent to element value. How can I achieve this ? For example if am parsing through XML file and sax parser hit's end element as than it should create o...

Is there a PHP library to create ASP.Net datasets for use with ASP.Net webservices?

I need to consume a ASP.Net webserice from PHP. So far reading data hasn't been to difficult. I have been able to pars the XML and find the information that I need. The problem I am running into is sending data back to the webservice. It is looking for the XML representation of a dataset. Is there anything out there that can generate the...

Self closing tags with XStream?

Is there a way to get XStream to generate self closing elements? E.g. <foo/> instead of <foo></foo> ...

Outputting SQL query results to GeoRSS

I get my information from my SQL query (Name, Description, Latitude, Longitude) but I'm having problems getting it into the proper format for GeoRSS so that it may be consumed by my Virtual Earth map. FOR XML AUTO isn't giving me quite what I want and I can't seem to find any examples of how to extract the output of a SQL query to GeoRSS...

Can java transform and validate the input at the same time?

I know how to call a java Transform and have it validate the output against a schema. What I want to do is: Validate the input and Transform it via xsl. I could: Create a Validator Validate and have it output a DOMResponse Pass the DOM to a Transformer. What I really want to do is have this done in one step and not have to create ...

PHP DOMDocument error handling

Hi, In my application I am loading xml from url in order to parse it. But sometimes this url may not be valid. In this case I need to handle errors. I have the following code: $xdoc = new DOMDocument(); try{ $xdoc->load($url); // This line causes Warning: DOMDocument::load(...) // [domdocument.load]: failed to op...

DOMElement cloning and appending: 'Wrong Document Error'

There's something I don't fully understand about node cloning with the PHP's DOM api. Here's a sample file that quickly duplicates the issue I'm coming across. $doc = new DOMDocument( '1.0', 'UTF-8' ); $root = $doc->createElement( 'root' ); // This doesn't work either $root = new DOMElement( 'root' ); $doc->appendChild( $root ); $doc...

iPhone - does TouchXML use an undocumented APIs?

Recently I've heard that Apple is using tools to search for references to undocumented APIs and are rejecting iPhone apps from the App Store because of it. The popular Three20 framework is causing people to get rejected. I also just saw that the KissXML library has also caused rejection. I'm looking for an Objective C DOM-based XML p...

Selecting Comments by their inner xml in xpath/xsl

Hi, Given the following xml document <root> <childnode0/> <childnode2/> <!--Comment1--> <childnode3/> <childnode4/> <!--Comment2--> </root> I know the xpath to select all the comments at a particular level in xsl string xPath = "/root/comment()"; However i'd like to select a comment where the inner xml is "Commen...

STaX code is not working with JAXB

Found a sample STaX code in below link: http://www.javarants.com/2006/04/30/simple-and-efficient-xml-parsing-using-jaxb-2-0/comment-page-1/ The below code doesn't work. I am not what is missing. JAXBContext ctx = JAXBContext.newInstance("com.sampullara.findbugs.om"); Unmarshaller um = ctx.createUnmarshaller(); int bugs ...

XPath Expression must evaluate to a node-set with OK XPath Path (Tested with online XPath tester and Oxygen)

The program I am working on is having a null reference exception whenever it tries to delete the node. The buggy code: First one is where the variable is declared for getting the name of the node to be deleted foreach (XmlNode InstalledListNodes in PackagesNode) { //If the title is the same as what...

Force xslt document() to load an external document over HTTP rather than directly from the file system.

Within my ASP.NET application, I'm loading an XML file into an XSLT with the document() method, as follows: <xsl:variable name="more-xml" select="document('generateXml.ashx')" /> This works fine when I run it locally, but fails when I deploy it to the server because the server finds generateXml.ashx through the file system, so it isn'...

Find a node in an XML file - performance improvement in C#

Say I need to find a particular node in an XML file, using C#. <node attribute="my-target-attribute"> "my-target-attribute" is a variable input at runtime. The node is in no particular place in the XML file, I basically just need to scan the entire XML hierarchy until I find a node with the matching attribute. Is there any way I can...

C# - XML vs MySQL

In this program I'm writing, it would need frequent database communication, and at the moment I'm using just XML files. Is there really a benefit from using MySQL or SQL in general over XML. Just note that I'm using C# so MySQL is not very fun to deal with in it (from what little experience I have). ...

Why does this XSLT code add a new line?

in IE (maybe FF too, but not sure) the following snippet from my XSL stylesheet... <td> <xsl:element name="img"> <xsl:attribute name="src"> <xsl:value-of select="image" /> </xsl:attribute> </xsl:element> </td> generates the following XHTML code... <td><img src=" someimage.jpg"></td> this new line that it inser...

Sorting XML data in PHP4

Hi there I have the following XML code: <?xml version="1.0" encoding="UTF-8"?> <connector_ret> <function name="search"> <row id="1"> <col id="1">AAA</col> <col id="2">243168</col> <col id="3">090828-000300</col> <col id="4">Subject</col> </row> <row id="2"> <col id="1">BBB</...

How to secure xml files in a website.

Hi, I'm creating an application that is able to generate xml licenses. The application is secured by forms authentication. Now the problem is that if I create a physical xml file that file can be downloaded even with the security enabled. How would you guys secure this license file? ...

VTD XML inner XPath Expressions

Hi I have a xml file for example like this <root> <test> <bla>test1</bla> </test> <test> <bla>test2</bla> </test> <test> </test> </root> Now I want to parse it with the vtd-xml-parser by using XPath Expressions. First I search for the test tags by VTDNav vn = vg.getNav(); AutoPilot ap = new AutoPilot(vn); ap.selectXPath("//...