You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Florian Wendland <fl...@freenet.de> on 2007/08/27 13:05:54 UTC

Schema Processing and @default-Attribute

Hello all,

I have tried to validate a simple xml document with a simple schema, 
too. If have only 1 Element with one attribute, which i have defines as 
optional, but with an default content.

I had exepected, that xerces would add the default attribute into the 
psvi (n my case a streamresult-object), but the result is a xml document 
without the default attribute.

Here is my Java-Code:
##################################################################
final Result res = new StreamResult(new FileWriter(new 
File("d:\\output.xml")));

final Source source = new StreamSource(new FileReader(new 
File(input.toURI())));

SchemaFactory sf = SchemaFactory.newInstance(NAMESPACE);

Schema f = sf.newSchema(schema);

Validator val =	f.newValidator();

val.validate(source, res);
##################################################################

Did i miss something?
Thx
mfw

---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org