xml

read xml data

I need to parse xml data from string bufer or string ..i do code as follows. here on the line document doc =db.parse(eventXml ) ..it throws exception-- plesae find below code and exception .plese help me Code --- eventXml = strBuffer.toString(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf...

How to use XML::XPath to get parent node?

I want to parse XML files using xPaths. After getting a node I may need to perform xPath searches on their parent nodes. My current code using XML::XPath is: my $xp = XML::XPath->new(filename => $XMLPath); # get all foo or foos node with a name my $Foo = $xp->find('//foo[name] | //foos[name]'); if (!$Foo->isa('XML::XPath::NodeSet') ||...

Converting Xml UTF-8 to ISO-8859-9 in c#

i have a long xml document just created by string builder with the starting tag like <?xml version="1.0" encoding="UTF-8"?> <xxxxxx> .. </xxxxxx> and i want to convert this xml to iso-8859-9 encoding type. How can i do this? Or anyone suggests me another way to create ISO-8859-9 encoding type xml in C#. ...

C#: byte array in xml CData

Hi all, I have a WCF service that is returning a block of xml. One element is a CData[] section. My application reads an HTML file out of the database and converts it to a PDF byte[] array using ABCPDF. Then in my XmlWriter Im adding the bytes to the CData section. The problem is the resulting xml looks like this: <![CDATA[System.B...

Webappas using client side XML database.

I am thinking for a new approach to make small webapps using XML. Here the the procedure to make it. First of all design a DataBbase for Application. This database is the soul of your application. This database contain all the necessary data and values. Now when a user requests to this webapp, the server will execute a server side scrip...

Evaluating XPath Commands with java

Hi I have an xml document like this <root> <cert id="1"> </cert> <cert id="2"> </cert> <cert id="3"> </cert> </root> now I get a request and want to select the cert with id 2 and want to return it in a function. What is the best way to do this? I thought about XPAth Expression, how can I use them in java? What would be ...

Javascript XML Comment Documentation

I'm building a custom library of composite controls that include their own javascript files as web resources. I've got DocProject running to generate my XML documentation CHMs and it's working great. However, when I set my solution to "Release" configuration, the runtime is still not extracting the XML comments from the embedded javasc...

C#: wcf return an XmlDocument?

Duplicate: serializing-generic-xml-data-across-wcf-web-service-requests Hi all, I have a WCF service where Im building up a block of XML using an XmlWriter. Once complete I want to have the WCF return it as an XmlDocument. But if I have XmlDocument in the [OperationContract] it doesnt work: [OperationContract] XmlDocument GetNex...

Does JDOM have any support for ID and IDREF?

<!DOCTYPE inventory [ <!ELEMENT book (title,author)> <!ELEMENT title (#PCDATA)> <!ELEMENT author (#PCDATA)> <!ATTLIST book year CDATA #IMPLIED> <!ATTLIST book myId ID #REQUIRED> <!ATTLIST book myIdRef IDREF #IMPLIED> ]> <inventory> <book year="2000" myId="1"> <title>Snow Crash</title> <author>Neal Stephenson</author> ...

Get xml attribute using actionscript 2.0

Hi, I'm new at actionscript 2.0, and I'd like to know how to read a xml attribute's value while iterating the xml. So far, I can get the xml elements, but I can't get this issue to work. Thanks in advance, Brian ...

Best practice using XML and XSD's to map against database

We have a ReST Web Service that uses POST - to insert data into database (unmarshall data from XML), and GET to retrieve data (marshalled into XML). An XSD is used to generate Java objects (via Sun's JAXB compiler) to marshall/unmarshall data to and from a database. We kind of froze the XSD as it is, because we thought this models the...

Problem with XML Schema

Hi, I would like log my keyboad strokes in a xml file. The attribute can be the key, and the value can be the timestamps or the other way ( doesn't matter). I would like to write the schema in the way that my output of schema would be exactly like this: <LoggingActions> <Keyboad> <Entry key="a">0</Entry> <Entry key="b">1...

XML Query in SQL Server 2008

I am just starting to use XML within SQL Server 2008. I have the data in the XML, but I am having a hard time finding good examples of querying the data. Can someone point me to a good place to start? For example, I would want to find all rows within SQL server that contain a certain criteria within the XML like all rows where the XML...

Deserializing XML to Objects defined in multiple schemas

I have an XML document containing types from 2 XML schemas. One (theirs.xsd) is a proprietary schema that I am integrating with (and cannot edit). To do this I am defining my own type (mine.xsd) that is an element within an 'any' element is the proprietary type. I use Visual Studio's xsd.exe to generate C# classes from the schemas. H...

Modeling: Xml vs. Relational Database

I am wondering if there are best practices for deciding between when a system should be modeled using XML and when it should be modeled using a relational database (I know you can store XML in a database, but there is an enormous difference between modelling a system using normalized db tables and modelling a system using XML-Schema). F...

Can't deserialize XML in WCF REST service

Hey everyone, I've just started playing with the REST starter kit, and I've hit a road block trying to build my own service. I'm trying to create a service for account management, and I can't get the service to serialize my objects, throwing the following error: Unable to deserialize XML body with root name 'CreateAccount' and root n...

XSD: how to restrict number of characters in string type attribute?

Hi, I have a question regarding adding restriction in my xml schema(xsd). I have a complex-type like: <-->xsd:complexType name="xxx"> <-->xsd:attribute/> ..... <-->/xsd:complexType> I have many attributes in this complex-type, and few of them are of string type. Now I want those string type attributes to be restricted to y no. o...

How to stream XML data using XOM?

Say I want to output a huge set of search results, as XML, into a PrintWriter or an OutputStream, using XOM. The resulting XML would look like this: <?xml version="1.0" encoding="UTF-8"?> <resultset> <result> [child elements and data] </result> ... ... [1000s of result elements more] </resultset> Because the...

Can I redefine an XSD Schema to change the maxOccurs attribute of a child of a type?

I am trying to extend an XML schema to change the number of times a child can occur under an element. In the original schema, the parent type is defined as such: <xsd:complexType name="CrimeLineBusiness_Type"> <xsd:complexContent> <xsd:extension base="PCLINEBUSINESS"> <xsd:sequence> <xsd:element ref="CrimeSchedule" minOccurs=...

XSD: complex type Attributes?

Hi, I am creating attributes for a complex-type element. I created an attribute, which itself is of complex type. When I tried compiling my code, it threw an error saying could not find simple-type attribute corresponding to the attribute of complex-type. Can't we create attributes of complex-type?..I also looked at w3c schools, but it ...