<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1491" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Does somebody know why I don't see any error
with JDOM ?</FONT></DIV>
<DIV><FONT face=Arial size=2>( See rules.xml and rules.xsd on bottom
)</FONT></DIV>
<DIV><FONT face=Arial size=2>Because there are 4 errors : <FONT
color=#ff6600> The 'name' attribute is not declared in rules.xsd....
</FONT><FONT color=#000000><filtre name = "filter1"> </FONT></FONT></DIV>
<DIV><FONT face=Arial size=2>It's an error because the element <filtre> is
not declared <FONT face="Times New Roman" size=3>as a complex
element </FONT> <FONT face="Times New Roman" size=3>.</FONT></FONT></DIV>
<DIV>With another website online validator , I have found this 4 errors . </DIV>
<DIV>
<DIV><FONT face=Arial size=2>But with JDOM , no error, and I can even
obtain the name attribut ....( which is not decalred....)</FONT></DIV>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>Is it a bug or not ?</FONT></DIV>...</FONT></DIV>
<DIV><FONT face=Arial size=2> log.info(" Filtre Name :
" + onefilter.getAttribute("name").getValue()
);</FONT></DIV>
<DIV><FONT face=Arial size=2> gives -> Filtre Name :
filter1 ...etc</FONT></DIV><FONT face=Arial size=2></FONT></DIV>
<DIV><FONT face=Arial size=2>
<DIV><BR>""""""""""""""""""""""""""""""""""""""""""""""</DIV>
<DIV>With another validator : 4 errors found</DIV>
<DIV>"""""""""""""""""""""""""""""""""""""""""""""""</DIV></FONT></DIV>
<DIV><FONT face=Arial size=2><B>Validation error: </B></DIV>
<DIV>
<P><SPAN id=xmltext><XMP><?xml version="1.0"?>
<habilitations xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation = "rules.xsd">
<population name = "pop1">
        </XMP><FONT color=#ff6600>Error at (6,13): The 'name' attribute is not
declared. An error occurred at , (6, 13).</FONT><XMP><filtre name = "filter1">ou=3106,ou=structures,ou=centrale,ou=mefi,o=gouv,c=fr</filtre>
        </XMP><FONT color=#ff6600>Error at (7,13): The 'name' attribute is not
declared. An error occurred at , (7, 13).</FONT><XMP><filtre name = "filter2">fonction=PROGRAMMEUR</filtre>
</population>
<population name = "pop2">
        </XMP><FONT color=#ff6600>Error at (11,13): The 'name' attribute is not
declared. An error occurred at , (11, 13).</FONT><XMP><filtre name = "filter1">ou=structures,ou=centrale,ou=mefi,o=gouv,c=fr</filtre>
        </XMP><FONT color=#ff6600>Error at (12,13): The 'name' attribute is not
declared. An error occurred at , (12, 13).</FONT><XMP><filtre name = "filter2">fonction=PUPITREUR</filtre>
</population>
<population name = "pop3">
        </XMP><FONT color=#ff6600>Error at (16,13): The 'name' attribute is not
declared. An error occurred at , (16, 13).</FONT><XMP><filtre name = "filter1">ou=structures,ou=centrale,ou=mefi,o=gouv,c=fr</filtre>
        </XMP><FONT color=#ff6600>Error at (17,13): The 'name' attribute is not
declared. An error occurred at , (17, 13).</FONT><XMP><filtre name = "filter2">ousigle=MCF/DIVERS</filtre>
</population>
</habilitations>
</XMP></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>"""""""""""""""""""""""""""""""""""</FONT></DIV>
<DIV><FONT face=Arial size=2>But with JDOM no error found</FONT></DIV>
<DIV><FONT face=Arial size=2>"""""""""""""""""""""""""""""""""""</FONT></DIV>
<DIV><FONT face=Arial size=2> String
fichierxml = args[0];</FONT></DIV>
<DIV><FONT face=Arial size=2>
SAXBuilder builder = new SAXBuilder("org.apache.xerces.parsers.SAXParser",
true);<BR> builder.setFeature("<A
href="http://apache.org/xml/features/validation/schema">http://apache.org/xml/features/validation/schema</A>",
true);</FONT></DIV>
<DIV><FONT face=Arial size=2> try
{<BR></FONT><FONT face=Arial
size=2>
Document doc = builder.build(fichierxml);</FONT></DIV>
<DIV><FONT face=Arial size=2>.../...</FONT></DIV>
<DIV><FONT face=Arial
size=2>-------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2>See my files:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>rules.xml</FONT></DIV>
<DIV><FONT face=Arial
size=2>-------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2><?xml
version="1.0"?><BR> <habilitations xmlns:xsi="<A
href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</A>"<BR>
xsi:noNamespaceSchemaLocation="rules.xsd"><BR> <BR>
<population name="pop1"><BR> <filtre
name="filter1">ou=3106,ou=structures,ou=centrale,ou=mefi,o=gouv,c=fr</filtre><BR>
<filtre
name="filter2">fonction=PROGRAMMEUR</filtre><BR>
</population><BR> <BR> <population
name="pop2"><BR> <filtre
name="filter1">ou=structures,ou=centrale,ou=mefi,o=gouv,c=fr</filtre><BR>
<filtre
name="filter2">fonction=PUPITREUR</filtre><BR>
</population> <BR> <BR> <population
name="pop3"><BR> <filtre
name="filter1">ou=structures,ou=centrale,ou=mefi,o=gouv,c=fr</filtre><BR>
<filtre
name="filter2">ousigle=MCF/DIVERS</filtre><BR>
</population>
<BR> <BR> </habilitations></FONT></DIV>
<DIV><FONT face=Arial
size=2>------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>rules.xsd</FONT></DIV>
<DIV><FONT face=Arial
size=2>------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2><xsd:schema xmlns:xsd="<A
href="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</A>"></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> <xsd:element
name="habilitations"><BR>
<xsd:complexType><BR>
<xsd:sequence minOccurs="0"
maxOccurs="unbounded"><BR>
<xsd:element name="population" minOccurs="0"
maxOccurs="unbounded"><BR>
<xsd:complexType><BR>
<xsd:sequence minOccurs="0"
maxOccurs="unbounded"><BR>
<xsd:element name="filtre" minOccurs="1"
maxOccurs="unbounded"/><BR>
</xsd:sequence><BR>
<xsd:attribute name="name" type="xsd:string"
use="required"/><BR>
</xsd:complexType><BR>
</xsd:element> <BR>
</xsd:sequence><BR>
</xsd:complexType> <BR>
</xsd:element> <BR></xsd:schema></FONT></DIV>
<DIV><FONT face=Arial
size=2>-----------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>