[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xerces-j-dev
Subject:    Schema Processing and @default-Attribute
From:       Florian Wendland <florianwendland () freenet ! de>
Date:       2007-08-27 11:05:54
Message-ID: 46D2B012.2090100 () freenet ! de
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic