xml

unique value from xml file

I have the following xml file: <contract> <ID>4</ID> <name>Name of contract</name> <commoditycode>CS,CP</commoditycode> </contract> I want to have the comma separated values in "commoditycode" in a dropdown list like this: <asp:DropDownList ID="DropDownList1" runat="server"> <asp:ListItem Text="CS" Value="CS" /> <...

Transmit generated XML file without saving to disk

I have a large web form application that I want to allow the user to export their data in case they don't want to complete the entire form at once. Then when they return they can import the data and continue where they left off. The reason for this is part of the requirement for the client is that no database is to be used. I've gotten...

XSLT escaping characters for XML attributes

I am working in a framework (cocoon) which means that the pages after I produce them are re-transformed by processes I have little or no control of. What I am doing is making a web service call, then transforming the results into an HTML page for presentation. Sounds like a job for XSLT. Everything works fine, until the data returned ...

is there a C library for validating XML against a XML schema?

See question. Also any links to example code or example code on how to validate an xml file against multiple schemas would be helpful. EDT: Sorry forgot to mention that this is for LINUX ...

Renaming tags in XML output

I have some code that generates XML from some tables. The tables that I'm querying were generated from an XSD file the describes the XML I am supposed to be generating. The problem is that the names of the tables and fields follow a different naming convention than those in the schema - for example, an element named "personID" in the sch...

XML Schema (XSD): How to express "At most one element from group A and at most one element from group b"?

Say I have two sets of XML elements: <One/> <Two/> <Three/> And <A/> <B/> <C/> And I want to have them as children of a bucket element: <Bucket> <A/> <One/> </Bucket> Or <Bucket> <C/> <Two/> </Bucket> But I don't want to allow more than one element from either set of elements. I.e: <Bucket> <A/> <B/> <On...

XML Schema: What does a restriction with only a base attribute mean?

What would it mean to create something like the following? <xsd:simpleType name="myField"> <xsd:restriction base="xsd:boolean"/> </xsd:simpleType> Notice there are no actual elements within the restriction (no min or max length, no enumerations, etc). I feel like this is basically setting the type of myField to xsd:boolean. Howe...

C++ Declarative Parsing Serialization

Looking at Java and C# they manage to do some wicked processing based on special languaged based anotation (forgive me if that is the incorrect name). In C++ we have two problems with this: 1) There is no way to annotate a class with type information that is accessable at runtime. 2) Parsing the source to generate stuff is way to compl...

Merging XML save files

My Java application's save files are in XML, and in certain cases, a user might want to merge two save files together. What packages have people used to do this? Any caveats to offer? ...

Why OPENXML only returns one element

Can somebody explain me why this T-SQL code only returns one row with the value "1"? I was expecting to get two rows ("1" and "2"). Am I missing something here? DECLARE @XMLDoc2 XML SELECT @XMLDoc2 = '<ids><id>1</id><id>2</id></ids>' DECLARE @handle2 INT EXEC sp_xml_preparedocument @handle2 OUTPUT, @XMLDoc2 SELECT * FROM OPENXML (@ha...

JSPX namespaces not visible for EL functions?

I'm attempting to use JSPX (pure XML syntax for JSP) and running into what seems like it should work, but doesn't. I'm importing taglibs using namespace declarations in the jsp:root element, then using these later on for elements as well as EL functions: <jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/ xmlns:c="urn:j...

c# writing excel file as xml...

I'm writing an xml file to be consumed by excel. excel wants this: <Cell><Data ss:Type="Number">25</Data></Cell> I'm writing this... <Cell> <Data ss:Type="Number">25</Data> </Cell> I get that EXCEL is picky, but since I'm using XElelments, how do i control the formatting of the output? here is my code to write a cell. foreach...

xdImage:getImageUrl -show attachment from different location

hello.. i have a problem which is how to get url attachment and display the attachment in form. what i know is method xdImage:getImageUrl is using to display the attchment if node(datsource) have in form. to display the data from datasaource into form, that data must be save in my database. but situasion is my attachment,i put in other l...

In TSQL, what is the best way to iterate through 1..* child nodes of XML data and retreive values?

I have a simple XML structure: <Receipt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ReceiptID="0" UserID="0" UserCardID="0" PaymentMethodID="1" MerchantID="0" MerchantTaxID="MERCHANT_TAX_ID" MerchantReceiptID="MERCHANT_RECEIPT_ID" MerchantReceiptReferenceID="MERCHANT_RECEIPT_REF_I...

How do I write a Regular Expression to match any non-empty content of an XML element that has no children elements?

I am trying to match elements that have no other children elements, but also have content. No content also includes whitespace and &nbsp; characters. I need to do this in C#. Take this XML for instance: <1> <2><3 /></2> <4> <5>This is match 1</5> </4> <6> </6> <7> &nbsp;&nbsp;&nbsp;&nbsp; ...

Add xml namespaces in the root

Hi all, How can I add multiple namespace in the root node using .NET XmlDocument? Thanks! ...

XSL: How to test if the current node is a descendent of another node.

Hi, I'm pretty new to XSLT, but need to use it for a CMS using at the moment. I've already come up with a problem, but I'll try to describe my it without going into too much information about the underlying CMS. If you need more context to help me, I can add it in. So all I want to do is test if a node of my xml is a descendant of a pa...

Loading XML into Document object in Google Chrome

I am unable to load an XML file into a JavaScript Document in Google Chrome with the following function: // load XML document based on whether the browser is IE or other browsers function loadXMLDocument(url) { var doc; if (window.ActiveXObject) // IE { doc = new ActiveXObject("Msxml2.DOMDocument.6.0"); doc.async ...

Which exceptions can be thrown by XmlSerializer?

Hi all, I'm using .NET XmlSerializer, XmlSchema and XmlReader to deserialize an XML document. Which exceptions may be thrown during validation and deserialization, since there are so many classes involved? Thanks in advance! ...

Which is faster, XML + XSL or CLR + DataBinding

Which is faster, XML with XSLT or CLR with DataBinding? I'm assuming that it's CLR + Databinding but I could be wrong. ...