471,610 Members | 1,345 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,610 software developers and data experts.

Creating XML element from XPath

Hi,

Is it possible to automatically create an XML element given an XPath query?
For example I have the following XML doc:

<topic>
<title>Hi this is the title</title>
<description>This is a simple desc</description>
</topic>

Now say I have an XPath query '/topic/age' which will return a null node if
I run it against the above XML doc. Now is there an easy way to automatically
create the age node if it doesn't exist? Or do I need to do manual parsing
and create the node manually?

For the above example probably you'll think that it should be easy to just
create the age node, but consider the other XPath such as
'/topic/description/comment' if the description node does not exist I want to
automatically create it.

So is this possible to do it with minimal work? I don't want to recreate the
wheel if .Net already has a simpler way of doing it - just couldn't find it
at the moment :)

Thanks,

Victor
Nov 12 '05 #1
0 1635

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Daniel Frey | last post: by
1 post views Thread by Chris Kennedy | last post: by
reply views Thread by magister | last post: by
reply views Thread by Mark Broadbent | last post: by
reply views Thread by Mark Broadbent | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by MichaelMortimer | last post: by
reply views Thread by CCCYYYY | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.