Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > [XML] filling empty attribute values with the default value specifiedin the XML schema.

Reply
Thread Tools

[XML] filling empty attribute values with the default value specifiedin the XML schema.

 
 
Stefan Siegl
Guest
Posts: n/a
 
      07-28-2003
Hello,

I was wondering if there is an easy possiblity to configure a XML parser
to automatically set empty attribute values to the default value
specified in the xml schema file.

I am currently using the dom4j framework with the validating Xerces2
SAX2 Parser.

Thanks in advance,
Stefan Siegl

 
Reply With Quote
 
 
 
 
Kermit T Tensmeyer
Guest
Posts: n/a
 
      07-28-2003

"Stefan Siegl" <(E-Mail Removed)> wrote in message
news:bg37d2$kd5qt$(E-Mail Removed)-berlin.de...
> Hello,
>
> I was wondering if there is an easy possiblity to configure a XML parser
> to automatically set empty attribute values to the default value
> specified in the xml schema file.
>
> I am currently using the dom4j framework with the validating Xerces2
> SAX2 Parser.


Why Yes Of Course it would be Simple to "write/configure" an XML parser
especially in a SAX environment to write default values for empty elements.

How? When the 'close' event fires off, have your code check for empty
elements, and generate the default values.

SAX uses notifications (registered callbacks as it were) to handle the
processing for each element. Xerces 2.5.0 makes it easier to handle the
code, but the code still must exist (that is written) to handle the open
element events, and close element events. It isn't magic, it's just a
structured way to parse event as they happen.
The validating section just uses a predefined set of open/close events to
map a logical file (physical or otherwise) onto the provided schema, and
notes the differences.


yep, you can make the notification elements that -you- provide generated
default value for conditions that you specify.

it's just that simple..


 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
attr_reader, default attribute value, and rdoc of attribute dkmd_nielsen Ruby 6 11-26-2008 05:40 PM
Change the value of an attribute according to the value of another attribute patrizio.trinchini@googlemail.com XML 8 08-22-2006 02:53 PM
wrapping long attribute value (line-continuation for attribute value) lophiomys@gmx.at XML 1 08-02-2006 01:18 PM
Using default a empty dictionary as a default value C Gillespie Python 3 03-22-2005 12:22 PM
Re: [XML Parser] filling empty attribute values with the default value specified in the XML schema. Bob Foster XML 0 07-30-2003 06:19 AM



Advertisments