xml

How can I generate XML with CR, instead of CRLF in XmlTextWriter

I'm generating XML via XmlTextWriter. The file looks good to my eyes, validates (at wc3), and was accepted by the client. But a client vendor is complaining that the line-endings are CRLF, instead of just CR. Well, I'm on a Win32 machine using C#, and CRLF is the Win32 standard line-ending. Is there any way to change the line-endings...

A tool to validate xml using xdr

That's basically the question, I have a XDR file which describes the format of the XML, and the XML itself. I can't find a tool/script/PHP solution to check the validity of the XML. Thanks for any help. ...

checking if a xml node exists in ASP Classic

Hi, For a project I'm doing I have a varied number of nodes with node names of nib"number"_title So I'm using a for loop and within that loop I'm using getElementsByTagName to ge the node but It brings up an error if it's trying to find a node thats not there. Microsoft VBScript runtime (0x800A01A8) Object required: 'xml.getElementsByT...

How do I escape a character in XSLT

I have an XSLT that transforms a XML to PLSQL I need to escape the character: > (greater than) ex: P_C710_INT_PROFILE_ID => I tried using > and putting the character in xsl:text with no luck Any ideas? Thanks ...

using XML with PHP

I've got a little problem with an XML file. I need to take the content of the tags (in the XML file) and save them in a MySql data base , using PHP . My supervisor asked me to use DOM, but everything I do isn't workin'. My XML file looks like this : <?xml version="1.0" encoding="windows-1252"?> <BIENS> <BIEN> <CODE_SOCIETE>0024</CO...

Access the request XML in a SOAP UI mock response script

Hello, I have a mock response, which needs to return a value that was in the request. For example, this request can come in: <myReqest><myValue>123</myValue></myRequest> I already have a mockResponse: <myResponse><yourValue>${theValue}</yourValue></myResponse> I know how to set the value of ${theValue} through the context variable...

PHP simpleXML: load string as node returns blank? (simplexml_load_string)

I'm trying to add a child to an XML-node by loading a string as an xml-node, but for some reason it returns an empty value ... // Load xml $path = 'path/to/file.xml'; $xml = simplexml_load_file($path); // Select node $fields = $xml->sections->fields; // Create new child node $nodestring = '<option> <label>A label</label> ...

Make JTidy leave XML alone, while converting HTML to XHTML

I'm trying to build a module that transforms HTML and XML via XSLT. I'm using the latest stable version of JTidy. I've pasted the code that deals with JTidy below: if (in != null) { if (convertToXhtml) { Document d = null; try { Tidy htmlSanitizer = new Tidy(); htmlSani...

WPF ListView with TreeView as ItemTemplate

Hi, I'm currently trying to create a ListView with a TreeView as ItemTemplate (a list of TreeViews). Furthermore, I need to bind a different XmlDataProvider on each one of them so they can each have a different XML source. I already know how to bind a XML source to a TreeView, but I don't know how to create a XMLDataProvider for each L...

How do I require that an element contain character data using XML Schema

If I have an xml document, for example: <colors> <color1>1452</color1> <color2></color2> <color3></color3> </colors> I want to define in an XML schema, that the color1 element must contain a value of type int, be non null, and non empty. So the above example would be valid, but if color1 was empty like color2 and ...

Alternatives to expat for stream-oriented XML parsing in C++

Are there alternatives to expat for stream-oriented XML parsing in C++? The data that I am dealing with arrives over a TCP connection and there are multiple XML documents to deal with, which means I have to reset the XML parser every time there is a new document. The parser doesn't need to be standards-compliant; I'm interested in bein...

Dynamically decide which XSL stylesheet to use

I'm trying to create a site which (among other things) will display data which is contained in xml files. I'm using xsl stylesheets to format everything, but some of the pages have similar content. Rather than have to make multiple xml sheets with duplicate data, is there a way to tell the xsl where the data is being displayed and have i...

Is there a standard XML spreadsheet code?

I want to create an 'universal' XML spreadsheet compatible document... Something compatible both with Microsoft Excel and especially with the open source alternatives (OpenOffice Calc, Gnumeric, ..). There's an issue I encounter when I try to border some cells. This is how you do it in Excel: <Border ss:Position="Bottom" ss:Line...

Inclusive and ordered/unordered definition of an XML element's children using RELAX NG compact syntax

I want to use RELAX NG compact syntax to validate an XML element whose children are one, two, three or n of a set of n specific elements. For instance, if the element is 'Layout' and there is a set of three specific elements: 'top', 'center' and 'bottom', the following XML element definitions would be valid: <Layout> <top/> <cen...

How can I access Android's preset style attributes, so I can change them for my own?

This Stack Overflow Post says how to change the style of a button across the application, but I'm unsure what reserved names are used for LinearLayout, RelativeLayout, etc so I can do the same for other elements/views. Does anyone know how to find all the preset names or can you tell me them? Thanks! ...

DOM4J and Hibernate: Dealing with the XML

So my web application is primarily using XML for client to server interaction and I'm currently persisting most of my backend using hibernate. I know there are XML databases and there that you can save XML using hibernate by invoking Sessions with the DOM4J entity but I'm not sure what the most efficient way of serving up the XML really ...

Read Xml String From DB in Classic Asp - odd return

Hey folks, So I've got our legacy app which is classic asp and I've got a table that looks like this: CREATE TABLE ChangeRequests( ChangeRequestsId int IDENTITY(1,1) NOT NULL, XmlData nvarchar(max) NOT NULL) Naturally "XmlData" has xml in it. The Xml string looks like this: <?xml version="1.0" encoding="utf-16"?> <ArrayOfControlData...

Python: Unicode and ElementTree.parse

Hi, I'm trying to move to Python 2.7 and since Unicode is a Big Deal there, I'd try dealing with them with XML files and texts and parse them using the xml.etree.cElementTree library. But I ran across this error: >>> import xml.etree.cElementTree as ET >>> from io import StringIO >>> source = """\ ... <?xml version="1.0" encoding="UTF-...

Version Control with XML diff and merge

Hi, I'm looking for an open source version control tool which can diff and merge XML files. The difficulty I have to find such a tool is, that I need a correct merge of a XML file comparing the nodes and not the lines. Any idea? Thanks! ...

How to save changed SimpleXML object back to file?

So, I have this code that searches for a particular node in my XML file, unsets an existing node and inserts a brand new child node with the correct data. Is there a way of getting this new data to save within the actual XML file with simpleXML? If not, is there another efficient method for doing this? public function hint_insert() { ...