xml

Removing anything between XML tags and their content

I would need to remove anything between XML tags, especially whitespace and newlines. For example removing whitespace and newslines from: </node> \n<node id="whatever"> to get: </node><node id="whatever"> This is not meant for parsing XML by hand, but rather to prepare XML data before it's getting parsed by a tool. To be more s...

Good Source for Learning How to Work with XML in F#

Does anyone have a good source for learning how to work with XML in F#? Multiple sources would be nice if available. ...

Getting rows from XML using XPath and Python

I'd like to get some rows (z:row rows) from XML using: <rs:data> <z:row Attribute1="1" Attribute2="1" /> <z:row Attribute1="2" Attribute2="2" /> <z:row Attribute1="3" Attribute2="3" /> <z:row Attribute1="4" Attribute2="4" /> <z:row Attribute1="5" Attribute2="5" /> <z:row Attribute1="6" Attribute2="6" /> </rs:data...

[XSLT] Get the total number of nodes and counting nodes

Is it possible to get the total number of XML nodes? Also, how does one do a for-statement with XSLT? ...

Question on XPATH for an XSLT File And XSLT If Statement

I have the following xml file <DriveLayout> <Drive driveVolume="/u" Group="sa" Owner="sa" totalSpace="4" /> <Drive driveVolume="/u" Group="sa" Owner="sa" totalSpace="16" /> <Drive driveVolume="/u" Group="sa" Owner="sa" totalSpace="510" /> <Drive driveVolume="/u" Group="sa" Owner="sa" /> <Drive driveVolume="/u" Group="sa" Owner="sa" tota...

Use a parent XML element as a container for reoccurring child elements?

Let's say you want to allow some particular XML element to occur 0+ times. For example, the <record> element can occur multiple times: <repository> <record>Record 1</record> <record>Record 2</record> <record>Record 3</record> </repository> Are there any compelling reasons to include a parent element as a container for these? F...

PHP Xml Attribute Parsing

I am Parasing XML currently using: $data = simplexml_load_string($xmlFile); foreach($data->item as $key => $current){ echo($current); } However I'm wondering, if a hit an element that looks like this: <thumbnail url="http://foo.bar" height="225" width="300"/> How do i pull the inner parts of this? (height, url, width) Thanks! ...

How to use XML annotations such as "XMLRoot" to parse schema like <field key="AA" id="BB">CC</field> in C#?

In order to parse <field key="AA" code="BB">CC</field> I suppose it should be something like [XmlRoot("field")] public Field { // Get AA [XmlAttribute("key")] string key; // Get BB [XmlAttribute("id")] string id; } Then how to get CC? I have looked at many places, but there are no solutions?? ...

Flash xml fed scroller - controling right left arrows issues

Hello guys, i need some hands on controlling scrolling text with 2 buttons left and right data fed by xml . my file structure is like this: main file: bg.swf ticker file : tikcer.swf buttons file: scrolling.swf ActionScript file: xml_ticker.as bg.swf is calling ticker on 0 level and scrolling buttons on level 1 ....

Incorporating XSLT generated table into a webpage

I am currently updating a webpage that has some very simple data displayed in a 2xnumberOfEntries table. The original is hard-coded into html, which, as a programmer, I find to be annoying. I decided that converting the data to a simple XML schema would be the best idea since I really have no need for the added features of a database. ...

Query on XPATH Statement

I have to write a generic template for finding an operation name and the namespace for that from a soap response. Generic i mean, that is applicable to any operation. So I don't know the operation name and the name space name but want to get them and modify back when I am sending the response. Here is the structure of the response: Typ...

XSL element with multiple namespace with different prefix

I wanna create an element in my XSL 1.0 with some namespace Just like this: <element xmlns:a = '...' xmlns:b = '...' xmlns = '...' > For some reason I can't use XSL 2.0, with <xsl:namespace> extension, there is only one allowed namespace declared for each element in XSL 1.0,how should I do? Regards, ...

Problem with recursive search of xml document using python.

I am trying to write a function that will take an xml object, an arbitrary number of tags, defined by tuples containing a tag name, attribute and attribute value (e.g ('tag1', 'id', '1')) and return the most specific node possible. My code is below: from xml.dom import minidom def _search(object, *pargs): if len(pargs) == 0: ...

Is there any easy way to create new xmls from a xml file using c#

For example <?xml version="1.0" encoding="UTF-8"?> <!--just example, the actual element structure is rather complex --> <components> <component name='a'/> <component name='b'/> <component name='c'/> </components> Now I want to create three separate xml file, whose root element is component and the file name is according to t...

Unit testing : nice to have feature question

I am testing a web service using VS2008 built in Unit testing , which btw isn't 1/2 bad. the webservice returns a complex datatype... What I would like to do now... is add code to serialize the return object, then display it as xml using internet explorer or ff (both of which show nicely formatted XML). What I really want to know is.....

Using XML parser implementation as OSGi service

Hello, I am developing an application using OSGi (Equinox platform), and one of the bundles needs to parse XML files. So far I implemented this with SAX (javax.xml.parsers.SAXParserFactory) and I would like to retrieve the SAXParserFactory from the platform. I saw the OSGi standard provides for a XMLParserActivator to allow JAXP implem...

Group Similar nodes in XML using XSLT

I have the following XML structure <?xml version="1.0" encoding="UTF-8"?> <Root> <BookingGroup> <PostCodes> <PostCode >AB</PostCode> <PostCode >AL</PostCode> </PostCodes> </BookingGroup> <BookingGroup> <PostCodes> <PostCode >AB</PostCode> <PostCode >D</PostCode> </PostCodes> </...

XmlDocument.Save doesn't output full QNames for Elements

I've encountered an issue whereby when I create an XML Document programmatically using the System.Xml classes and then use the Save method the output XML doesn't use QNames for the Nodes and just uses local names. eg Desired Output <ex:root> <ex:something attr:name="value"> </ex:root> But what I currently get is <root> <somethin...

XPath selection

I'm having trouble writing an XPath expression to select nodes that contain certain elements, while excluding siblings of this element that I'm not interested in. I suspect this can't be done with XPath alone and that I will need to use XSLT. Using this source document <items> <item id="foo1"> <attr1>val1</attr1> <attr...

Reading xml stream

Sorry to be asking such similar question again, I am trying to read the following XML document: <markets currency="GBP"> <market id="2908368" nextId="2908395"> <status>ACTIVE</status> <commissionRate>2.5</commissionRate> <marketType>ANY_NUMBER_OF_WINNERS</marketType> <selections type="MainBets"> <selection id="65...