Hi Ishara, ishara karunarathna <isharaar...@gmail.com> wrote on 03/17/2011 01:01:06 PM:
> Hi Micheal, > > Here is the basic idea I have to implement xml:id component. > Implementing xml:id support as a separate component be the xml:id > processor. And it will implement the following requirements. > > 1. Normalize the value of each xml:id attribute. > Normalize each xml:id attributes according to the ID type attributes > normalization rules [1] and then The infoset normalized value > property is updated with the normalized value. > > 2. Perform ID type assignment with the normalized value (in other > words give it an ID type if it doesn't already have one). > This can be done by making the type of the attribute "ID" in the > infoset or post schema validation infoset (PSVI) and I think > org.apache.xerces.xs package me be useful to do this. > > 3. Report an error if the constraints on the xml:id are violated > (in other words validate the xml:id). > For validating has to be done in DTD, XML Schema and RELAX NG based > validating techniques. I was referring to these constraints in the xml:id spec. Though many of the rules may be similar this is separate from DTD, XML Schema, etc... validation. "An xml:id processor must assure that the following constraints hold for all xml:id attributes: * The normalized value of the attribute is an NCName according to the Namespaces in XML Recommendation which has the same version as the document in which this attribute occurs (NCName for XML 1.0, or NCName for XML 1.1). * The declared type of the attribute, if it has one, is "ID". All declarations for xml:id attributes must specify "ID" as the type of the attribute. An xml:id processor should assure that the following constraint holds: * The values of all attributes of type "ID" (which includes all xml:id attributes) within a document are unique." > 4. Pass the processed xml:id attribute (and other XNI events) to > the next component in the pipeline. > XNI information set events that are generated by the scanner is > taking as the input of the processor and the processed event is > passing to the next component in the pipeline. > > Could you tell me whether my approach is ok or the required > modifications here. Any existing component can be use to model this > module. (At the moment I checked how xinclude component works) I think you've got the general idea for the component. > And any reference to study how normal attributes are normalized and > forward to the next component is implemented in Xerces. You may want to have a look at org.apache.xerces.impl.dtd.XMLDTDValidator.normalizeAttrValue(). > Thank you. > Ishara Karunarathna. > [1] http://www.w3.org/TR/REC-xml/#AVNormalize Thanks. Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: mrgla...@ca.ibm.com E-mail: mrgla...@apache.org