xml

Is empty string valid XML?

Is '' a valid piece of XML? Can '' insert into oracle xblob column or XML column from MSSQL? ...

Pretty printing XML with javascript

I have a string that represents a non indented XML that I would like to pretty-print. For example: <root><node/></root> should become: <root> <node/> </root> Syntax highlighting is not a requirement. To tackle the problem I first transform the XML to add carriage returns and white spaces and then use a pre tag to output the XML. ...

XML Schema: Element with attributes containing only text?

I'm having difficulty searching for this. How would I define an element in an XML schema file that looks like this: <option value="test">sometext</option> I can't figure out how to define an element that is of type "xs:string" and also has an attribute. I'm fairly new to writing XML schemas, so please bear with me! Here's what I've g...

Problem summing a total in XSLT Template

Hi everyone, I am having a problem trying to simply sum some values using XSLT. I a template online and have modified it for my needs. (link text) No matter how I try, I cannot get the template to sum the numbers. I either end up with a total of "0" or a concatenation of the numbers I want summed. If someone could take a look and point...

How can I break a table row in xsl after a specified count?

Hi I have the following xsl that sorts my xml alphabetically: <xsl:template match="/"> <xsl:apply-templates /> </xsl:template> <xsl:key name="rows-by-title" match="Row" use="translate(substring(@Title,1,1),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')" /> <xsl:variable name="StartRow" select="string('&lt;tr &gt;')" /> ...

Error using JSTL XML taglib - attribute xml does not accept any expressions

I'm getting the following error when I try to use the JSTL XML taglib: /server-side-transform.jsp(51,0) According to TLD or attribute directive in tag file, attribute xml does not accept any expressions I'm looking into the tlds etc, but if anyone knows what this is an can save me some time, it'd be appreciated! If it helps, I get t...

Add, update and edit an XML file with PHP

I have an xml file which I would like to create a form/table around to add, edit and delete records using PHP. Currently I use simpleXML to load the XML file, and display its content on various pages. Is there any way I can create a table that shows all results, and allows me to either edit or delete that particular row of the table wh...

Web XML Editor - with XML syntax highlighting

I am trying to find a web-based XML Editor with at least syntax highlighting. Something simple in Javascript or Flash would be nice. The more lightweight, the better it would be. ...

SQL Server xml.modify delete method

I have a problem with removing an attribute from a node. Example: DECLARE @processID int SET @processID = 8 DECLARE @xml XML SET @xml = ' ' SET @xml.modify('delete (/Process/Shapes/Shape/@subProcessID[/Process/Shapes/Shape/@subProcessID = sql:variable("@processID")])') SELECT @xml Gives the result: ...

How can I convert convert docx or wordml xml files to xsl-fo?

I've been looking for a method to convert docx or wordml xml to xsl-fo. I read this post: http://stackoverflow.com/questions/156683/what-is-the-best-xslt-engine-for-perl but I'm having exceptional problems getting apache-fop going. I was able to download the bins and run it locally but the formatting was a little off and it didn't ma...

C# Serialization XML

Hello Everybody, just a simple question. Is there an attribute to skip empty arrays in the xml-serialization of c#? This would increase human-readability of the xml-output. Thanks in advance Matze ...

How do I get the whole text of an element using ElementTree?

That is, all text and subtags, without the tag of an element itself? Having <p>blah <b>bleh</b> blih</p> I want blah <b>bleh</b> blih element.text returns "blah " and etree.tostring(element) returns: <p>blah <b>bleh</b> blih</p> ...

Creating xml from with java

Hi folks, I need your expertise once again. I have a java class that searches a directory for xml files (displays the files it finds in the eclipse console window), applies the specified xslt to these and sends the output to a directory. What I want to do now is create an xml containing the file names and file format types. The format ...

How can I read an XML file into a buffer in C?

I want to read an XML file into a char *buffer using C. What is the best way to do this? How should I get started? ...

.NET Signed XML Prefix

Is there a way to set the prefix on the Signature of a Signed XML Document (SignedXml class in .Net)? So instead of: <Signature xmlns="http://www.w3.org/2000/09/xmldsig#&gt; ... </Signature> I could have the following: <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#&gt; ... </ds:Signature> ...

Is there anyway to change the content type of an XML document, in the XML document?

Is there anyway to change the content-type of an XML document, in the XML document? I'm working with a really old system that passes back HTML (and we are trying to make it return XML). I'm retrieving it from XMLHttpRequest, and I noticed using netcat that it isn't passing back any content-type headers. When I receive the XMLHttpRe...

XML Schema: Element that can contain elements or text?

How would I define an element that can either contain plain text or contain elements? Say I wanted to somehow allow for both of these cases: <xs:element name="field"> <xs:complexType> <xs:sequence> <xs:element ref="subfield" minOccurs="0" maxOccurs="unbounded" /> </xs:sequence> <xs:attribute name="name" type="xs...

Dynamically instanting classes in Objective-C, possible?

My problem is the following. I have a method which simply takes an XML excerpt and an XPath. It then should create me an array of objects for that XML excerpt. Meaning if I get passed the following XML: <user> <name>Bob</name> <age>50</age> </user> My method will instantiate an instance of the class User and use key-value-coding t...

How to include Javascript in xml-document?

The task seems to be pretty easy: how to include a Javascript file in xml-document so that at least Opera and Firefox could actually parse it and execute the code? ...

Trying to store XML content into SQL Server 2005 fails (encoding problem)

Folks, I have a webservice that returns data in ISO-8859-1 encoding - since it's not mine, I can't change that :-( For auditing purposes, I'd like to store the resulting XML from these calls into a SQL Server 2005 table, in which I have a field of type "XML NULL". From my C# code, I try to store this XML content into the XML field usi...