Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XML
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old October 29th, 2012, 12:47 PM
Authorized User
Points: 141, Level: 2
Points: 141, Level: 2 Points: 141, Level: 2 Points: 141, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2012
Posts: 35
Thanks: 18
Thanked 0 Times in 0 Posts
Question Create an XML document using JAXP and XML fragments.

Hi all.

I hope this is the correct place to ask this question, but if not then a pointer in the right direction would be good.

Does anyone have a link to a resource that will show me how to create an XML document using JAXP? In my ideal world I want to create the 'master' document from various fragments of XML. The element and attribute values for these fragments will be taken from input entered by the User via the Application's UI.

So, for a document with say four sections I would have as resources four empty templates that I populate with the User's input then using these four populated templates create an new complete XML document and include the schema and other references as needed.

Thanks.

--
William
Reply With Quote
  #2 (permalink)  
Old October 29th, 2012, 02:11 PM
mhkay's Avatar
Wrox Author
Points: 18,438, Level: 59
Points: 18,438, Level: 59 Points: 18,438, Level: 59 Points: 18,438, Level: 59
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,954
Thanks: 0
Thanked 290 Times in 285 Posts
Default

JAXP is an umbrella term for the Java APIs for a large number of XML technologies. Which did you have in mind? XSLT?
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
Reply With Quote
  #3 (permalink)  
Old October 29th, 2012, 04:44 PM
Authorized User
Points: 141, Level: 2
Points: 141, Level: 2 Points: 141, Level: 2 Points: 141, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2012
Posts: 35
Thanks: 18
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by mhkay View Post
Which did you have in mind? XSLT?
Ah well there's the rub, I don't know as I don't know what the best approach is. All I want to do after the User has completed the input form is to load a fragment of XML :
Code:
<foo attrA="" attrB="" attrC="" ...>
    <bar attrA="" attrB="" />
</foo>
via an appropriate method, set the foo element's attributes then the bar element and keep it as an XdmNode(?) for inclusion in the 'master' document. After the user has completed all of the input forms and I've extracted all of the various sections' inputs from the user I create my 'master' XML document my adding the XdmNodes to a single document.

Does this make any more sense?

--
William
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Split xml file with result document and javax.xml.transform.Transformer. nisargmca XSLT 3 January 12th, 2010 06:26 AM
create xml document by xpath in java zhebincong XML 1 October 6th, 2009 05:07 AM
create 2-columns table from an XML document frosty1575 XSLT 2 May 16th, 2006 05:17 AM
XML validation with Schema/DTD using JAXP Hendrik XML 0 December 28th, 2004 06:58 AM
Access XML fragments embedded in Word 2003 debsoft General .NET 2 May 7th, 2004 08:55 AM



All times are GMT -4. The time now is 02:04 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.