xml

How to transport an XML fragment in an XML Document

Hi, I'm using an AJAX system on a web application, and for one of the objects i return, it needs to contain an xml fragment. Unfortunately, being AJAX, i'm sending the values back via XML already. So, at the moment, i have something that looks like this (ignoring the fact the tags arent perfect. <Transport> <Message> <Conte...

XSLT For Breaking Elements Into Sets?

Is XSLT a good solution for breaking an XML document into sets by element name? For example, if my document is: <mydocument> <items> <item>one</item> <item>two</item> <item>three</item> <item>four</item> </items> </mydocument> I want to split this into sets of 3 or less like: <mydocument> <items page="1"> <item>one</item> <item>two</...

Ignoring "Content is not allowed in trailing section" SAXException

I'm using Java's DocumentBuilder.parse(InputStream) to parse an XML document. Occasionally, I get malformed XML documents in that there is extra junk after the final > that causes a SAXException: Content is not allowed in trailing section. (In the cases I've seen, the junk is simply one or more null bytes.) I don't care what's after t...

Why am I getting org.xml.sax.SAXException for this block of XML?

I've anonymised a bit of this. Hopefully it doesn't detract from the useful message. stringARRAY is where I think I'm getting thrown at, but I'm not sure, so if I'm looking at the wrong place, lemme know. From the WSDL <xsd:element name="LongishOpName"> <xsd:complexType> <xsd:sequence> <xsd:element maxOccurs="unboun...

php script return specific xml tag value

i need php script to extract the ip address from the following xml page www.ip-address.com/test.xml <dnstools> <service_provider>Domain Tools</service_provider> <provider_url>http://www.domaintools.com/&lt;/provider_url&gt; <date>Wed, 12 May 2010 00:43:07 GMT</date> <unix_time>1273624987</unix_time> <ip_address>94.252.157.241</ip_addres...

Is there any way to get the combine two xml into one xml in Linux.

XML one is something like that: <dict> <key>2</key> <array> <string>A</string> <string>B</string> </array> <key>3</key> <array> <string>C</string> <string>D</string> <string>E</string> </array> </dict> XML Two is something like that: <dict> <key>A</key> <ar...

Why is IE8 on XP not properly reading from XML using JQuery?

Given this XML in data.xml <?xml version="1.0" encoding="utf-8"?> <data> <bar>100</bar> </data> I want to display the content from the "bar" element using the following code in test.html <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt; </head> <bod...

System.ServiceModel.Syndication.SyndicationFeed throws when the RSS document includes a <script> block embedded in an element

The code: using (XmlReader xmlr = XmlReader.Create(new StringReader(allXml))) { var items = from item in SyndicationFeed.Load(xmlr).Items select item; } The exception: Exception: System.Xml.XmlException: Unexpected node type Element. ReadElementString method can only be called on elements with simple or empty content...

Receive XML via POST with ASP.NET

I have to set up an XML "web service" that receives a POST where the 'Content-type header will specify “text/xml”.' What is the simplest way to get the XML into an XDocument for access by VB.NET's axis queries? I don't believe the web service is guaranteed to follow any protocol (e.g. SOAP, etc); just specific tags and sub-tags for var...

JAXB, how to marshal without a namespace

I have a fairly large repetitive XML to create using JAXB. Storing the whole object in the memory then do the marshaling takes too much memory. Essentially, my XML looks like this: <Store> <item /> <item /> <item /> ..... </Store> Currently my solution to the problem is to "hard code" the root tag to an output stream, and marsha...

Select more then one node from XML using LINQ

I have such XML <root> <content> .... </content> <index> .... </index> <keywords> .... </keywords> </root> But I need to select just and nodes. <content> .... </content> <index> .... </index> I found out how to select just one node. XElement Content = new XElement("content"...

why tempspace results here??

if we supposed that "A.B." is a value for an xml element called given-names the following code converts this value to "A.tempspacetempspaceB." instead of "A. B." foreach (XElement initial in doc.XPathSelectElements("//given-names")) { string v = initial.Value.Replace(".", ". ").TrimEnd(' '); initial.SetValue(v); } So why temp...

C# - Grabbing Input > DataSet > XML

Ok so I have made a DataSet that reads the data hardcoded but unsure how I can read input from user to replace that hardcoded data. I have a form with a textbox and submit button, I want to save data to xml after going through my DataSet. Kinda new to programming, hoping someone can give me some pointers here. public partial class For...

Separating positive values from 'zero' values in an XSLT for-each statement

I am traversing an XML file (that contains multiple tables) using XSLT. Part of the job of the page is to get the title of each table, and present that title with along with the number of items that table contains (i.e. "Problems (5)"). I am able to get the number of items, but I now need to separate the sections with 0 (zero) items in...

I want to use Xpath in Android to parse XML

Hi guys, I like to use Xpath to parse XML ins java, but when I am doing the same on android, XPath is not found. any idea how it can be implemented. and also if its not possible then any other parser for android which is fast? Thanks Kai ...

XML sitemap locking on database export

What would be the best approach for saving site categories from sql server 2005 db for use with menu control(asp.net 3.5)? I already have the full xml sitemap string from dataset.GetXml(), so I 'only' need to take care of writing the xml to the file and avoid locking it up because the whole site navigation depends on this sitemap. What h...

More XML Problems - Undeclared Entity 'nbsp'

I'm getting the error: Line 49: xml = r.ReadToEnd(); Line 50: Line 51: System.Xml.Linq.XDocument xmlDoc = System.Xml.Linq.XDocument.Parse(xml); Line 52: Line 53: var query = from p in xmlDoc.Descendants("member") On my XML. When I run the code to generate the XML in an empty page, it ...

Why can't I start XML entity names with 'xml''?

<XmlInfo /> I ran into problem using Perl's popular SOAP::Lite module, where it wouldn't accept XML entity names starting with "xml" (regardles letters' case). The author of the module replied to email saying that entity names starting with "xml" are not permitted in XML specification, but I couldn't find it in W3C's documents for 1.0 ...

Does the XML specification states that parser need to convert \n\r to \n always, even when \n\r appears in a CDATA section?

Hi, I've stumbled in a problem handling the \line-feed and \carriage-return characters in xml. I know that, according to http://www.w3.org/TR/REC-xml/#sec-line-ends, xml processors are required to replace any "\n\r" or lone "\r" sequences with "\n". The specification states that this has to be the behaviour for handling any "external pa...

XSL - How to tell if element is last in series

I have an XSL template that is called (below). What I would like to do is be able to tell if I am the last Unit being called. <xsl:template match="Unit[@DeviceType = 'Node']"> <!-- Am I the last Unit in this section of xml? --> <div class="unitchild"> Node: #<xsl:value-of select="@id"/> </div> </xsl:template> Ex...