xml

Best way to change the value of an element in C#

I'm trying to look at the best way of changing the value of an element in XML. <MyXmlType> <MyXmlElement>Value</MyXmlElement> </MyXmlType> What is the easiest and/or best way to change "Value" in C#? I've looked at XMLDocument and it will cause a load of the whole XML document to memory. Could you do it safely with the XMLReader....

How do I explode an attribute with values separated by a , into seperate elements

I have a an attribute who's value may be one or more text strings all delimited by a comma. I wish to transform using XSL the attribute value(s) into their own element; e.g <post title='Hello World" tags="Test,Hello,World /> In which I would like it transformed to; <post> <title>Hello World</title> <tag>Test</tag> <tag>Hello</tag> ...

Creating xml files from a database or list of variables.

I have a template and need to create several xml files. The file contains one variable -this- to replace several times, save it as that name -this-.xml and then repeat for each of the values in my text or excel list or from a database - How would I best go about doing this? ...

Efficient way to encode CDATA elements

Ok, I'm reading data from a stream using a StreamReader. The data inside the stream is not xml, it could be anything. Based on the input StreamReader I'm writing to an output stream using an XmlTextWriter. Basically, when all is said and done, the output stream contains data from the input stream wrapped in a element contained in a p...

The Advantages/Disadvantages of XML compared to RDMS

Are there disadvantages of using XML, instead of RDMS? The reason I ask this is because my data is more naturally represented by XML structure, rather than RDBMS. I initially thought of storing the data in relational database, but the lack of flexibility of relational database to handle tree-like data structure was putting me of. So I am...

xml namespace to java, how to model 'choice' ?

What is the best way to represent in java a "choice" namespace tag? ie. <xs:complexType name="MyType"> <xs:sequence> <!-- common elements here --> <xs:element type="xs:string" name="name" ... /> </xs:sequence> <xs:choice> <xs:element name="stringValue" type="xs:string"></xs:element> <xs:element name="intValue" type...

XML Schema: Restrict child element based on attribute value of parent element?

Is there any way to restrict the use of an XML element's sub elements, depending on the attribute value of the parent element in XML Schema? How does the schema have to look like? <option name="mike" value="excset"> <excludingsets> <excludingset> <option name="hd"/> </excludingset> </excludingsets> </option> <option na...

Converting XML between schemas - XSLT or Objects?

Given: Two similar and complex Schemas, lets call them XmlA and XmlB. We want to convert from XmlA to XmlB Not all the information required to produce XmlB is contained withing XmlA (A database lookup will be required) Can I use XSLT for this given that I'll need to reference additional data in the database? If so what are the argum...

Read XMl File to String Array

I have a XML File and I want to read the data and assign it to a string array, so Operative would be assign to 1 array and JobLocation to another <Demo> <JOBOperatives> <Operative> <Clock>aaaa</Clock> <Name>aaaaa</Name> <MobileNumber>00000000010</MobileNumber> <OperativeTrade>3</OperativeTrade> <OperativeTicket>1</Operati...

How do I load a Grammar xml file that uses SAPI 5.3 tags?

My question is how can I load a grammar file that uses the tags they list in the MSDN docs? I want to use the format tags that are documented in MSDN under the heading Grammar Format Tags (SAPI 5.3). http://msdn.microsoft.com/en-us/library/ms723634(VS.85).aspx There it lists tags like DEFINE, LIST, OPT etc. However whenever I try to ...

Generating a tree diagram from an XSD file

I would like to generate a tree diagram out of an XML schema definition. Liquid XML Studio has a visual XSD tree editor, and lets me save my tree as a .png file, which fulfills some of my needs. But I am wondering if there is a tool out there that lets users convert XSD files to web pages, where the diagram can be clicked, expanded, and ...

ASP.NET: Will Saving an XmlDocument to the Response.OutputStream honor the encoding?

i want to send the xml of an XmlDocument object to the HTTP client, but i'm concerned that the suggested soltuion might not honor the encoding that the Response has been set to use: public void ProcessRequest(HttpContext context) { XmlDocument doc = GetXmlToShow(context); context.Response.ContentType = "text/xml"; context.Resp...

Tool or library for comparing xml files.

I am looking for an XML comparing tool that understands xml. It cannot be a line by line comparision like WinMerge or Beyond Compare. An ideal solution would be one that shows changes similar to the way Word 2007 shows track changes. DeltaXML does this, but does not come with a real GUI 'out of the box' and is $500 per user!: Xamxm...

Java's default JAXB implementation is chosen over my classpath.

I've written a java application that utilizes JAXB for XSL transforms. I've included the saxon9.jar in my classpath so that I can use XSLT 2.0 rather than XSLT 1.0 on the command line. java -classpath ./lib/saxon9.jar:./ -jar myApp.jar I've included code in my XSL to report the XSLT used. <xsl:comment><xsl:text > </xsl:text>XSLT Ver...

Is there any value in creating a pool of Dom4J SaxReader objects?

I'm using Dom4J 1.4.2. Right now my code creates a new SaxReader every time I want to parse a new XML document: SAXReader reader = new SAXReader( ); Is there any value in creating a pool of SaxReader objects and just reusing them? How much overhead is involved in creating a new SaxReader on every call? My code could get one from t...

How can I call an XML Action from an HTML Form?

I'm trying to submit an HTML form to an action of an XML page. The XML page is called, for instance, myXMLPage.xml. The action name would be myAction. In the form action tag this is what I have: <form action="myXMLPage.xml/myXMLPage.myActoin"> </form> I know this is probably wrong, but I can't figure out what's correct. Can someone ...

What's the best approach for reading in XML data and building a query to insert the values into a SQL Server DB?

What's the best approach for reading in XML data and building a query to insert the values into a SQL Server DB? Anyone have a best approach for this type of scenario? ...

Can i make an XSLT transformation directly in html page ?

I know namespace are used to describe, like doctype, but is there a way or a trick to transform inner namespace html with an xsl using xsd ? <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml" x...

Write Dataset to SQL Table

I have converted a complex XML File to a Dataset that has 7 Tables and around 70 Columns I have created the tables in SQL Server to match the ones in the Dataset using the XML Schema. How can I easily write my Dataset to the SQL tables? ...

Ajax: Definition vs Implementation? (XML vs JSON vs Other)

AJAX actually means Asynchronous Javascript And XML. This term was derived because (as I know the story) the first people who started this process transferred data from the server to the client via XML. Lately (well ever since I've started using it actually), JSON has been around and appears to be a real alternative to XML. From my (p...