I am trying to use VBSctipt to do an xslt transform on an xml object.
The xsl file I'm translating includes the <xsl:import href="script.xsl"/> directive. If I use the absolute href (http://localhost/mysite/script.xsl) it imports the style sheet fine; however, if I use the relative path (script.xsl) it reports "resource not found". I ne...
I've had a hard time finding good ways of taking a time format and easily determining if it's valid then producing a resulting element that has some formatting using XSLT 1.0.
Given the following xml:
<root>
<srcTime>2300</srcTime>
</root>
It would be great to produce the resulting xml:
<root>
<dstTime>23:00</dstTime>
</root...
Is it possible to use PHP's SimpleXML functions to create an XML object from scratch? Looking through the function list, there's ways to import an existing XML string into an object that you can then manipulate, but if I just want to generate an XML object programmatically from scratch, what's the best way to do that?
I figured out tha...
Hi people,
While trying to generate classes from a xsd, i got this error:
java.lang.IllegalArgumentException: Illegal class inheritance loop. Outer class OrderPropertyList may not subclass from inner class: OrderPropertyList
My xsd define a element to group a unbounded element like this:
<element minOccurs="0" name="orderProperty...
I have an XML document with un-namespaced elements, and I want to use XSLT to add namespaces to them. Most elements will be in namespace A; a few will be in namespace B. How do I do this?
...
Give the following XML structure
<html>
<body>
<div>
<span>Test: Text2</span>
</div>
<div>
<span>Test: Text3</span>
</div>
<div>
<span>Test: Text5</span>
</div>
</body>
</html>
What is the best xpath query to locate any span with text that starts with Test?
...
I want to generate some XML in a stored procedure based on data in a table.
The following insert allows me to add many nodes but they have to be hard-coded or use variables (sql:variable):
SET @MyXml.modify('
insert
<myNode>
{sql:variable("@MyVariable")}
</myNode>
into (/root[1]) ')
So I coul...
This XML file contained archived news stories for all of last year. I was asked to sort these stories by story categor[y|ies] into new XML files.
big_story_export.xml
turns into
lifestyles.xml
food.xml
nascar.xml
...and so on.
I got the job done using a one-off python script, however, I originally attempted this using XSLT. This r...
I have a collection of data stored in XDocuments and DataTables, and I'd like to address both as a single unified data space with XPath queries. So, for example, "/Root/Tables/Orders/FirstName" would fetch the value of the Firstname column in every row of the DataTable named "Orders".
Is there a way to do this without copying all of th...
What's the accepted way of storing quoted data in XML?
For example, for a node, which is correct?
(a) <name>Jesse "The Body" Ventura</name>
(b) <name>Jesse \"The Body\" Ventura</name>
(c) <name>Jesse "The Body" Ventura</name>
(d) none of the above (please specify)
If (a), what do you do for attributes? If (c), is it really...
I've got a php script. Most of the time the script returns html, which is working fine, but on one occasion (parameter ?Format=XML) the script returns XML instead of HTML.
Is there any way to change the returned mime type of the php output on the fly from text/html to text/xml or application/xml?
...
When should you use XML attributes and when should you use XML elements?
e.g.
<customData>
<records>
<record name="foo" description="bar" />
</records>
</customData>
or
<customData>
<records>
<record>
<name>foo</name>
<description>bar</description>
</record>
</records>
</customData>
...
When loading XML into an XmlDocument, i.e.
XmlDocument document = new XmlDocument();
document.LoadXml(xmlData);
is there any way to stop the process from replacing entities? I've got a strange problem where I've got a TM symbol (stored as the entity #8482) in the xml being converted into the TM character. As far as I'm concerned this...
I need to generate an XML file in C#.
I want to write the code that generates this in a file that is mostly Xml with code inside of it as I can in an ASP.NET MVC page.
So I want a code file that looks like:
<lots of angle brackets...>
<% foreach(data in myData)
{ %>
< <%= data.somefield %>
<% } %>
More angle bracke...
I tried:
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(f);
Node mapNode = getMapNode(doc);
System.out.print("\r\n elementName "+ mapNode.getNodeName());//This works fine.
Element e = (Element) mapNode; //This is where the error occurs
//it seem...
I am parsing an RSS feed from the following URL:
http://rss.sciam.com/ScientificAmerican-Global?format=xml
// $xml_text is filled with the contents read from the URL
$xml_parser = xml_parser_create();
$res = xml_parse($xml_parser, $xml_text);
if (!$res) {
$error =
xml_error_string(xml_get_error_code($xml_parser)).
" at line ...
Hello
I need to create XML in Perl. From what I read, XML::LibXML is great for parsing and using XML that comes from somewhere else. Does anyone have any suggestions for an XML Writer? Is XML::Writer still maintained? Does anyone like/use it?
In addition to feature-completeness, I am interested an easy-to-use syntax, so please desc...
Is there a way to get more useful information on validation error? XmlSchemaException provides the line number and position of the error which makes little sense to me. Xml document after all is not about its transient textual representation. I'd like to get an enumerated error (or an error code) specifying what when wrong, node name (or...
I need to replace the contents of a node in an XElement hierarchy when the element name and all the attribute names and values match an input element. (If there is no match, the new element can be added.)
For example, if my data looks like this:
<root>
<thing1 a1="a" a2="b">one</thing1>
<thing2 a1="a" a2="a">two</thing2>
<thing2 ...
Calling Validate() on an XmlDocument requires passing in a ValidationEventHandler delegate. That event function gets a ValidationEventArgs parameter which in turn has an Exception property of the type XmlSchemaException. Whew!
My current code looks like this:
ValidationEventHandler onValidationError = delegate(object sender,
Vali...