aspose file tools*
The moose likes XML and Related Technologies and the fly likes create xml document by xpath in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply locked New topic
Author

create xml document by xpath in java

zb cong
Ranch Hand

Joined: Jan 14, 2002
Posts: 416
as i know, i can navigate existing xml document by xpath in java, i wonder if i can create a xml document framework by xpath in java?
something like:

Document doc = someobject.create(xpath expression);

then i can use DOM to fill the framework?

Thanks
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18909
    
    8

I am guessing you already have a Document, and you want to use XPath expressions to extract a specific set of nodes from the document. Yes, you can do that using classes in the javax.xml.xpath package. However, an XPath expression always returns a list of nodes and not a document, so you can't create a new Document using XPath. And I'm not sure what this "framework" is which you're asking about.
zb cong
Ranch Hand

Joined: Jan 14, 2002
Posts: 416
this the same question with:

http://www.coderanch.com/t/465297/XML-Related-Technologies/create-xml-from-xml-schema
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: create xml document by xpath in java