xml

find common parent using Xpath

Hi, I was wondering if there was any way to access common parent node using Xpath. <outer> <main> <a><b> sometext </b></a> <c><d> sometext2 </d></c> </main> </outer> I have the text nodes sometext and sometext2. is there a way i can access main (common parent) of these two nodes? I do not know the layout of the...

Should XSD occurrence bounds be on the sequence or the element?

If I have an element with one or more subelements, should the min/maxoccurs attributes be on the xsd:sequence element, the xsd:element, both, or neither? <xsd:element name="books"> <xsd:complexType> <xsd:sequence minOccurs="1" maxOccurs="unbounded"> <!-- here? --> <xsd:element ref="book" minOccurs="1" maxOccurs="unbounded"/>...

XML Entity for "/" ?

So I'm writing some XML generating code, and found that the following attribute value was screwing up the XML formatting: "Jim/Bob" So I looked into the XML Entities used as escape sequences and every list I saw did not include one for the forward slash. Am I missing something obvious here? Seems like the sort of thing you'd want to ...

how to create xml from xml fragments

I am using SQL Server 2005 and I have a XML Data Type column that stores xml fragments like so in one big table: row 1 ..... <Order date='2009-02-11' customerID='4' /> row 2...... <OrderItem OrderID='6' ItemID='477' quantity='1' /> I would like to create an XML using T-SQL that looks like this from these nodes: <Orders> <Order data...

WCF: Individual methods or a generic ProcessMessage method accepting xml.

My company is developing an application that receives data from another company via TCP sockets and xml messages. This is delivered to a single gateway application which then broadcasts it to multiple copies of the same internal application on various machines in our organisation. WCF was chosen as the technology to handle the interna...

XPath search based on dynamic regular expressions

Hi I have an XML like the one below: <?xml version="1.0" encoding="UTF-8"?> <Configuration> <Destinations> <Destination name="DEST1" > <From>AMA*</From> </Destination> <Destination name="DEST2" > <From>AMAZON</From> </Destination> ...

encode ]]> in a cdata

Exact duplicate: http://stackoverflow.com/questions/538163/how-do-i-write-the-literal-inside-a-cdata-section-with-it-ending-the-section if I'm building some xml and using , how do I encode data that may include a "]]>" substring? would it be "]]>"? I ask because I always thought cdata content was literal content. ...

Is there *simple* way to extract deeply nested values with XML::Simple?

I'm using Perl's XML::Simple to parse deeply nested XML and would like to extract a small list of elements about 4 levels down: A B C D1 D2 D3 Ideally I want to do this on the input step, if possible. Like this: my @list = XMLin($xml, { SomeAttribute => 'ButWhat?' }); ending up with the same thing as if I d...

Finding top-level xml comments using Python's ElementTree

I'm parsing an xml file using Python's ElementTree, like that: et = ElementTree(file=file("test.xml")) test.xml starts with a few lines of xml comments. Is there a way to get those comments from et? ...

Why does createProcessingInstruction in VBA generate incomplete output?

The following VBA code generates <?xml version="1.0"?> as output. Dim XML As New DomDocument Dim pi As IXMLDOMProcessingInstruction '.... some code that sets the root element of the document Set pi = XML.createProcessingInstruction("xml", "version='1.0' encoding='UTF-8'") XML.insertBefore pi, XML.documentElement Why is the ...

XSLT - How to select XML Attribute by Attribute?

Hello, this is the structure of my source xml: <root> <DataSet Value="A"> <Data Value1="1" Value2="anythingA1" /> <Data Value1="2" Value2="anythingA2" /> <Data Value1="3" Value2="anythingA3" /> <Data Value1="4" Value2="anythingA4" /> <Data Value1="5" Value2="anythingA5" /> </DataSet> </root> from which I like to create some variables ...

Get original image dimensions when embedding image in WordprocessingML

I am dynamically creating Word documents using the Velocity template engine. The documents are created in XML (using the Microsoft Office 2003 WordprocessML XML standard). I am embedding an image (encoded in Base64 format) inside the WordML in the traditional way: <w:pict> <v:shapeType> ... </v:shapeType> <w:binData w:na...

XML XSL Transform From Stream

Hi I have a memory stream in which I use XMLTextWriter to write out some XML. What I want to do is transform this XML using the XSL.transform feature. The thing is I don't want to create a temp. XML file, I want to somehow use the stream to Transform it into the XSL. Thank you for any suggestions. ...

XML Parsing with C#?

I'm working on a project for school that involves a heavy amount of XML Parsing. I'm coding in C#, but I have yet to find a "suitable" method of parsing this XML out. There's several different ways I've looked at, but haven't gotten it right yet; so I have come to you. Ideally, I'm looking for something kind of similar to Beautiful Soup ...

How would I use LINQ2XML in this scenario?

I have my LINQ2XML query working half way to my goal: var XMLDoc = XDocument.Load("WeatherData.xml"); var maximums = from tempvalue in XMLDoc.Descendants("temperature").Elements("value") where tempvalue.Parent.Attribute("type").Value == "maximum" select (string)tempvalue; var minimums ...

Regex to Indent an XML File.

Is it possible to write a REGEX (search replace) that when run on an XML string will output that XML string indented nicely? If so whats the REGEX :) ...

Is it possible to link to an outside url from within an xml document?

I am using a flash web template that pulls the images from an xml document. I want to link from an image after it is clicked on to another portion of the site. Here is some sample code from the document: <gallery id="1" name="public relations"> <image width="121" height="161" image="images/pr/pr_01.jpg"/> I want the image "pr_01.jpg...

Default XML namespace, JDOM, and XPath

I want to use JDOM to read in an XML file, then use XPath to extract data from the JDOM Document. It creates the Document object fine, but when I use XPath to query the Document for a List of elements, I get nothing. My XML document has a default namespace defined in the root element. The funny thing is, when I remove the default name...

How to return XML in ASP.net?

Similar Questions How to return XML in ASP.NET References How Return XML From ASPX in ASP.NET 1.1 http://forums.asp.net/t/1298093.aspx How do you output XML from ASP.NET? Creating an ASHX handler in ASP.NET What is the proper method to return XML in ASP.net? Any thorough answer must address why you must have, why you cannot ha...

How to find out an element node with a empty string value in xsl

Hi, everyone: I am working on transforming a xml file from old version to new version. Here is the basic template which i am using: <xsl:template match="*"> <xsl:element name="{name(.)}" namespace="{namespace-uri(.)}"> <xsl:copy-of select="@*"></xsl:copy-of> <xsl:apply-templates></xsl:apply-templates> </xsl:element>...