James

 In researching this, we've seen several complaints about the way many of the major XML players (BizTalk for example) handle optional content.  That is really more the area I am drilling into- for example if one of our customers is trying to use our tool to create a target XML document and the DTD says an element is optional, that probably means they don't want that element output to the document if it is empty.  So we'll see if I can come up with something universal here or not- will let you know.  Not really familiar with MSV so will take a look at that too-

Thanks
Brian

James Strachan wrote:
1d6701c1c547$7eca6db0$[EMAIL PROTECTED]">
Hey Brian

Noone has built anything like that yet. Though quite a few folks seem to
want something like that - generate an empty document based on a DTD then
allow folks to add/modify certain bits.

Just a thought - would the MSV library from Sun help here - its an abstract
schema tool that allows validation of XML against DTD, XML Schema, RelaxNG,
Relax and Trex. It might be a bit 'meta' or abstract for you - just using a
DTD would be easier - but it might be worth a look.

By all means go for it - I'm interested it seeing what you come up with and
we could submit your work into the dom4j distribution if you like?

James
----- Original Message -----
From: "Brian Young" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sen t: Wednesday, March 06, 2002 4:08 PM
Subject: [dom4j-user] best way to retrofit a dom4j Document to a DTD


Our product allows users to map data from a number of datasources into a
target dom4j Document. As a result, the user may overlook or not wish
to be concerned about specific rules specified in the DTD.

For example, assume a choice in a DTD (ELEM1 | ELEM2 | ELEM3) - BTW this
is a super trivial example.

Now, the document the user creates if they don't use a provided feature
to suppress elements may end up looking like this and not be valid as
far as the DTD is concerned:
<ELEM1></ELEM1>
<ELEM2>somedata</ELEM2>
<ELEM3></ELEM3>

Using a little logic, one could determine based on the choice in the DTD
that the output should really look like this (given that ELEM1 and ELEM3
are empty):

<ELEM2>somedata<ELEM3>

The document will now validate. I thought I'd ask if someone has built
anything like this on top of dom4j, because I'm getting ready to build< br>it utilizing dom4j, Wutka's DTD parser and my own logic (which could get
complex with nested choices, sequences, etc)

Thanks!


_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com






Reply via email to