BizTalk Utilities Xselerator XSLT IDE


Forum main page

Most active member

Login page
Register
Log out

Search page


View our event calendar
Add general event such as an upcoming software release or conference
View all birthdays

Public image gallery
Upload your images in your profile

Profile editing page
Subscription list page
Address book page

Member list page
View the most active member
User groups listing

Private message page

TopXML Discussion Forum TopXML Discussion Forum

Forums  Register  Login  My Profile  Inbox  Address Book  My Subscription  My Forums 

Photo Gallery  Member List  Search  Calendars  FAQ  Ticket List  Log Out

XML/XSD Default values

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [Ask XML questions here] >> Java XML Discussions >> XML/XSD Default values Page: [1]
Login
Message << Older Topic   Newer Topic >>
XML/XSD Default values - 20 June 2007   
sauronlord

 

Posts: 4
Score: 0
Joined: 20 June 2007
Status: offline
Hi,
I'm new to XML, XSD and XSLT.
I was wondering if there is a way to "fill out" an XML document with its default values, as if "expanded" so that my XSLT processor could use these defaults in generating the output.

I think if I had a schema-aware XSLT processor (SAXON-SA), then I could get this done easily as the transformation would be done against an XML document validated against an XSD.

That is not an option for my company for various reasons.

Is there a 2-stage process I can execute (in Java SAX/DOM?) that will "fill out" the required default values for elements or attributes?

I see there are validator classes, but none of these allow me to "write back" the resultant XML(with defaults populated) so that I may use the "expanded" form in subsequent processing.

Thanks,
Post #: 1
RE: XML/XSD Default values - 20 November 2007   
geniousmonkey

 

Posts: 1
Score: 0
Joined: 20 November 2007
Status: offline
Hello sauronlord,

I'm facing the same problem as you.
Actually I need to do a filling tool from an xsd file with very few time for this.
This tool must fill an existing xml file with all the mandatory elements that are not
already filled.

I wonder why it's so difficult to find a solution for this.

If this "default" attribute exists, it should be used for something...????

Maybe you have found a way to do it?

Thanks in advance

(in reply to sauronlord)
Post #: 2
RE: XML/XSD Default values - 7 May 2008   
sauronlord

 

Posts: 4
Score: 0
Joined: 20 June 2007
Status: offline
Hi,
Sorry it took me so long to get back. I was just searching for this question again and my post came up and it took me a moment to realize it was me!

I have not found out how to do it with XSLT (without using SAXON-SA). I believe that will work however.

Another way might be to walk through the XML document programmatically and check if a default exists and then populate it. However this cumbersome and I tried to stay away. The problem sort of "went away" on itself at work because we ended up doing something slightly different--- however now on a different project it is coming back up :)

If I find anything I'll try to post back here, but I imagine it won't be for maybe a month or two before I get results.

Right now I am looking at Code Synthesis XSD for XML->C++ object data binding, and it shows some promise for other things and hopefully it has a mechanism for "filling out" defaults.

good luck,





(in reply to geniousmonkey)
Post #: 3
RE: XML/XSD Default values - 1 September 2008   
janebush08

 

Posts: 3
Score: 0
Joined: 1 September 2008
Status: offline
let me know once your research gets completed...

_____________________________

asp net web development

(in reply to sauronlord)
Post #: 4
Page:   [1]
All Forums >> [Ask XML questions here] >> Java XML Discussions >> XML/XSD Default values Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts



Email TopXML

Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.188