Lists Home |
Date Index |
It's not obvious (to me) from your code why you would get the odd
results you described, but there is still a lot of missing information.
Like, what version of the JRE are you running? Have you installed your
own parser and/or jaxp or is it pre-installed (as in 1.4)? Have you set
the system properties (e.g., org.xml.sax.driver) that change the default
You can save yourself some time. If you come back and say you are using
Sun's JRE 1.4 with the default parser and the application as stated,
people will tend not to believe that it (either Crimson or Xerces) will
behave as you report, which will not be helpful. If you are using a
different parser, try it with the default parser.
Marcus Robinson wrote:
> The code that sets up the parser is as follows:
> XMLReader parser = XMLReaderFactory.createXMLReader();
> parser.setEntityResolver(new XSDEntityResolver());
> cking", true);
> ImportSchemaHandler ish = new ImportSchemaHandler(this);
> InputStream is = new FileInputStream(schemaFile);
> parser.parse(new InputSource(is));
> Using parser: org.xml.sax.XMLReader
> In the handler I am then using attributes.getValue("name") in the
> startElement method to retrieve the attribute value.
> If any more information is needed let me know, thanks for the help,
> Marcus Robinson
> ----- Original Message -----
> From: "Michael Kay" <firstname.lastname@example.org>
> To: "'Marcus Robinson'" <email@example.com>; <firstname.lastname@example.org>
> Sent: Thursday, March 25, 2004 5:54 PM
> Subject: RE: [xml-dev] Parsing Attibute Values containing "." in a Schema
>>There's obviously something wrong either with your code or with your
>>but since you haven't shown us your code or identified your parser it's
>>to see how anyone can help you.
>># -----Original Message-----
>># From: Marcus Robinson [mailto:email@example.com]
>># Sent: 25 March 2004 16:41
>># To: firstname.lastname@example.org
>># Subject: [xml-dev] Parsing Attibute Values containing "." in a Schema
>># Hi, Can anyone help me?
>># I am trying to parse an XML schema in Java using an
>># XMLReader. All is well apart from:
>># When I parse:
>># "<xsd:attributeGroup name="attr.identifierref">"
>># And use attribute.getValue"name", I get "identifierref".
>># When I parse the element:
>># " <xsd:attributeGroup name="attr.identifierref.req">"
>># I also get "identifierref". The ".req" is lost.
>># I want to get the full value, i.e. "attr.identifierref.req"
>># or attr."identifierref" , or even just "identifierref" and
>># . Is there a feature or property that is set incorrectly, or
>># is this not possible? The reason I want to do this is when
>># parsing the XML I want to link an attribute back to the
>># schema, but an attribute "identifierref" will refer two two
>># attributes rather than just the correct one.
>># Many thanks in adavance,
>># Marcus Robinson