Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Building a XML file thanks to a XPath-like syntax

From: "roy axenov" <r_axenov@----.-->
To: NULL
Date: 3/2/2007 11:49:00 AM

On Mar 2, 4:58 pm, "redcic" <cedric.lou...@gmail.com>
wrote:
> I would like to build a xml file using Xerces. I know how
> to build a single node at a time.
> However, what I would like to be able to do is to use a
> XPath-like syntax to build my xml file. Something of the
> type:
>
> myElement = doc.createElement('parentName/elementName')

That sounds like a rather bad idea to me. Why invent a
primitive, non-standard language, easily confused with
XPath, which *is* standard but addresses a wholly different
problem domain (to quote from the spec: 'XPath is a
language for addressing parts of an XML document'), and
incurring a penalty for parsing that language run-time?

Especially since a standard language for serializing XML
DOM Documents and XML DOM Document Fragments as plain text
already exists. Hint: it's called XML.

> where on can recognize a XPath syntax in
> 'parentName/elementName'.

Like that's a good thing. How do you add attributes or text
nodes? What if someone experiences a braino and attempts to
stuff a predicate in your 'XPath' expression?

> What class of Xerces allows me to do that ?

What gave you an idea a class like that would exist?

Either use XML (and suffer run-time performance penalty for
parsing it) or stuff all the elements you need created into
a container and iterate until blue in the face. This
'XPath' thingo you came up with combines the worst of both
worlds.

--
roy axenov



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent