xml

Are .NET 3.5 XPath classes and methods XSLT 2.0 compatible?

I'd like to use regular expressions in selecting elements using the match function. I'd prefer not to use an external library (such as saxon) to do this. ...

Asp XML Parsing

Hi I am new to asp and have a deadline in the next few days. i receive the following xml from within a webservice response. print("<?xml version="1.0" encoding="UTF-8"?> <user_data> <execution_status>0</execution_status> <row_count>1</row_count> <txn_id>stuetd678</txn_id> <person_info> <attribute name="firstname">john</attribute> ...

How can I load xml from a url instead of a file path in .NET?

We currently have code like this: Dim xDoc = XDocument.Load(myXMLFilePath) The only way we know how to do it currently is by using a file path and impersonation (since this file is on a secured network path). I've looked at XDocument.Load on MSDN, but I don't see anything. ...

What are the relative advantages of XMLEncoder and XStream?

Suppose I want to store many small configuration objects in XML, and I don't care too much about the format. The XMLDecoder class built into the JDK would work, and from what I hear, XStream works in a similar way. What are the advantages to each library? ...

Given this XML, is there an xpath that will give me the 'test' and 'name' values?

I need to get the value of the 'test' attribute in the xsl:when tag, and the 'name' attribute in the xsl:call-template tag. This xpath gets me pretty close: ..../xsl:template/xsl:choose/xsl:when But that just returns the 'when' elements, not the exact attribute values I need. Here is a snippet of my XML: <xsl:template match="fie...

Is there an XML XQuery interface to existing XML files?

My company is in education industry and we use XML to store course content. We also store some course related information (mostly metainfo) in relational database. Right now we are in the process of switching from our proprietary XML Schema to DocBook 5. Along with the switch we want to move course related information from database to XM...

PHP Associative arrays to and from XML

Is there an easy way to marshal a PHP associative array to and from XML? For example, if I have the following array: $items = array("1", "2", array( "item3.1" => "3.1", "item3.2" => "3.2" "isawesome" => true ) ); How would I turn it into something similar to the following XML in as few lines as possible...

XML schema construct for "any one or more of these elements but must be at least one"

I'm trying to set up part of a schema that's like a "Sequence" where all child elements are optional, but at least one of the elements must be present, and there could be more than one of them. I tried doing the following, but XMLSpy complains that "The content model contains the elements <element name="DateConstant"> and <element name=...

javascript XSLTProcessor occasionally not working

The following javascript supposes to read the popular tags from an XML file and applies the XSL Stylesheet and output to the browser as HTML. function ShowPopularTags() { xml=XMLDocLoad("http://localhost/xml/tags/popular.xml?s=94987898"); xsl=XMLDocLoad("http://localhost/xml/xsl/popular-tags.xsl"); if (window.ActiveXObject...

Check if XML Element exists

How can someone validate that a specific element exists in an XML file? Say I have an ever changing XML file and I need to verify every element exists before reading/parsing it. ...

How to simultaneusly append several nodes to a XML file from different EXE instances, using Delphi

I have a command line tool, written in Delphi, which job is to insert a node in a XML file and then immediately exit. I need to make it possible several instances of the tool to be executed simultaneously and insert nodes to one and the same XML. To achieve this purpose I have introduced a simple file "mutex" - the tool creates one tem...

Is it valid to have a 'choice' of 'group' elements when defining an XML Schema (XSD)

Is it valid to have a 'choice' or 'group' elements when defining an XML Schema (XSD) i.e. is the following valid <xs:complexType name="HeaderType"> <xs:sequence> <xs:element name="reservation-number" type="ReservationNumberType" minOccurs="1" maxOccurs="1" nillable="false" /> <xs:choice minOccurs="1" maxOccurs="1"> <xs:...

Validate XML using a custom DTD in PHP

Is there a way (without installing any libraries) of validating XML using a custom DTD in PHP? ...

Intefacing EJB - XML using JAXB interface.

I was trying to add the xml schema to an existing EJB project. JAXB is used to bind the XML-Schema to java class. As we are going to use the search engine to crawl thru DTO when EJB is in session. I could not find any direct approach as to map entity class file to XML-Schema. The only way we could achieve so far is to create the Web...

XSLT multiple file inputs?

Within an XSLT document, is it possible to loop over a set of files in the current directory? I have a situation where I have a directory full of xml files that need some analysis done to generate a report. I have my stylesheet operating on a single document fine, but I'd like to extend that without going to another tool to merge the x...

Number of nodes meeting a conditional based on attributes

Below is part of the XML which I am processing with PHP's XSLTProcessor: <result> <uf x="20" y="0"/> <uf x="22" y="22"/> <uf x="4" y="3"/> <uf x="15" y="15"/> </result> I need to know how many "uf" nodes exist where x = y. In the above example, that would be 2. I've tried looping and incrementing some var, but I can'...

Are there any resources about the PHP XMLWriter functionality?

The PHP documentation can be found here, but I think it's rather lacking. There are no examples of how to use these functions, and few (if any) of the pages have user comments. So where might I be able to find an explanation (and example code) on how to use these functions to write an XML document? ...

How to convert an XML file into a .Net class?

Can someone please remind me how to create a .Net class from an XML file? I would prefer the batch commands, or a way to integrate it into the shell. Thanks! ...

What is the correct XPath for choosing attributes that contain "foo"

I haven't used XPath much nor read through tutorials. Given this XML, what XPath returns the first three nodes: <bla> <a prop="Foo1"/> <a prop="Foo2"/> <a prop="3Foo"/> <a prop="Bar"/> </bla> ...

What's wrong with my XPath/XML?

I'm trying a very basic XPath on this xml, and it doesn't find anything. I'm trying both .NET and this website, and XPaths such as "//PropertyGroup", "/PropertyGroup" and "//MSBuildCommunityTasksPath" are simply not working for me (they compiled but return zero results). ...