xml

Stream-lined xml builder/parser in Android?

I'm learning the Android api from a book, and it seems like there isn't any mention of a stream-lined api for dealing with raw xml (reading and writing). His suggestion for parsing is the XmlPullParser, and his examples look horrendous considering the kind of api's I'm spoiled by in other platforms (LINQ to XML especially). Is this the...

Creating an XML Schema with attributes and elements contingent on other attributes

I'm trying to develop a schema that will validate some existing XML files I've inherited. I'd like to have the schema do as much of the validation work as possible. The challenge is that attributes and elements are contingent on the values of other attributes. The real data is pretty abstract, so I've created some simple examples. Let's...

Construct XML with dynamic label and attributes in Scala?

I want to be able to do this: val myXml = <myTag { someAttributes }> </myTag> (because I don't know what the attribute details are at compile time) and this: val myXml = <{someTag}></{someTag}> This isn't valid Scala syntax. The closest I can come is using the Elem object to construct elements, but it's being a little troublesome ...

Manipulating namespace prefixes in SAAJ / raw xml access within SAAJ

My SAAJ-based client generates the following XML and sends it to a .NET web service: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"&gt; <SOAP-ENV:Header> <AuthenticationHeader xmlns="http://www.w3.org/2001/XMLSchema-instance"&gt; <Password xmlns="http://schemas.datacontract.org/2004/07/"&gt;temp123&lt;/Pas...

can't understand these xml encoding woes

The following hunk of code (snipped for brevity) generates an xml doc, and spits it out to a file. If I open the file in Visual Studio it appears to be in chinese characters. If I open it in Notepad it looks as expected. If I Console.WriteLine it look correct. I know it's related to encoding, but I though I had all the encoding ducks ...

Help me for create a xml, based on Room Count of hotel

Help me for create a xml, based on Room Count of hotel For example: I have 5 Rooms: Room1, Room2, Room3, Room4 and Room5. In Room1: 2 Adults, 1 Child, Age 6 In Room2: 1 Adult, 0 Child In Room3: 2 Adults, 2 Child, Age 6, Age 7 In Room4: 1 Adult, 0 Child In Room5: 2 Adult, 1 Child, Age 6 If Child is 0 and Adult count comes same ( her...

Scala XML \\ copies xmlns attribute. Why and how can I stop it?

In Scala REPL: val input = <outerTag xmlns="http://xyz"&gt; <innerTag> </innerTag> </outerTag> input\\@"innerTag" => <innerTag xmlns="http://xyz"&gt; </innerTag> How do I stop Scala do this? Why can't it just give me <innerTag> </innerTag>? How can I stop this happening (or remove the xmlns attributes simply)? Thanks! Joe Clari...

XPathNavigator.SetValue Throws NotSupportedException

I have the following code, whose last line results in a NotSupportedException on every execution, and I haven't found a way around it. This hypothetical analogous code finds a "book" with a specific title, with the goal of updating it to the new title. It does find the correct node, but fails to update it. XPathDocument xpathDoc = new X...

Writing XML to memory instead of disk

How do i go about writing the results of a FOR XML PATH stored procedure into memory rather than a file on disk? Current way of doing things: private void GetChartData(string OC_Ttl1, string OC_Ttl2, string OC_OL31) { OC_Ttl_1 = OC_Ttl1; OC_Ttl_2 = OC_Ttl2; OC_OL3_1 = OC_OL31; //Output xml DataSet orgDataSet = new ...

Creating objects from XML

I have the following XML that uses the name “Part” in multiple locations. I just want to access the first level elements called “Part” and not for my Linq expression to also pickup the child elements called “Part”. I’ve used the following Linq to accomplish what I want but it seems a bit messy. Can it be improved ? <Stuff> <Parts> ...

How to "Open" XML data in Oracle

Hello all, Here is an example of some TSQL that I would like to rewrite in PL/SQL. DECLARE @xml XML SET @xml = '<theRange> <theRow><First>Bob</First><Last>Smith</Last><Age>30</Age></theRow> <theRow><First>Sue</First><Last>Jones</Last><Age>34</Age></theRow> <theRow><First>John</First><Last>Bates</Last><Age>40</Age></theRo...

Setting value for a node in XML document in Python

I have a XML document "abc.xml": I need to write a function replace(name, newvalue) which can replace the value node with tag 'name' with the new value and write it back to the disk. Is this possible in python? How should I do this? ...

SQL Server XML Declare Namespace

Hi All, I would like to have a few namespaces available by default when running an XQuery in SQL Server 2005, is this possible? For example, I would like to do the following: select * from TableWithXML where FieldWithXML.exist( declare namespace nsp="http://www.example.com/exampleNamespace"; nsp:root/nsp:childnode) = 1 Without having...

Generating XML from XSDs

Hello SO Readers, I have an bunch of XSDs which in turn inherits schema's from different XSD's and I need to generate an XML file for testing purpose from this XSD. I am using the oXygen XML Editor to do this but when I try to do it, it is not working for me and it says please define root node but than it does not allow me to do so. So...

namespace error when using XMLStarlet

I have an xml configuration file which works fine in Java, and I'm trying to parse out some info from it using XMLStarlet inside a script. The error I'm getting is: xml sel -t -m "Config/Application" -v "@rmiPort" -n config.xml namespace error : Namespace prefix log4j on configuration is not defined <log4j:configura...

SWF file displayed but xml data not loading into the swf embedded in aspx page

the flash map calls the xml external file which contains data the map shows in firefox and works a treat but wont show any of the xml data Help ...

Embed swf XML path issue

Hi, I am trying to embed swf to html, and I'm using SwfObject 2.0 My swf has a xml file with it, the swf are in the same folder with index.html, and the xml file is in a subfolder called xml. So far everything's fine and working. However, I have another html page that's in a subfoler and wants to load the same swf and xml. This time, th...

applying xml to xslt help

I have an XML file that is very long, but here is a shot excerpt. <?xml version="1.0" encoding="UTF-8"?> <dicom> <attr tag="00020000" vr="UL" len="4">190</attr> <attr tag="00020001" vr="OB" len="2">00\01</attr> <attr tag="00020002" vr="UI" len="30">1.2.840.10008.5.1.4.1.1.88.11</attr> <attr tag="00080090" vr="PN" len="14...

Embed an HTML anchor in an XML doc

How would I go about embedding an html anchor inside of an xml element? Consider the following xml: <?xml version="1.0" encoding="utf-8"?> <Customers> <Customer> <FirstName>Joe</FirstName> <LastName>Mama</LastName> <Email><a href="mailto:[email protected]">[email protected]</a></Email> <Webs...

What is the meaning of NSXMLParserErrorDomain error 5.?

Ok, I am back on this task. I have my XML properly download from my webserver with a URL pointing to the server's file, however, when I detect the network is 'unreachable' I simply point the URL to my application's local XML and I get the following error (N.B. the file is a direct copy of the one on the server). I cannot find detail desc...