[ 
https://issues.apache.org/jira/browse/XERCESJ-1113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13065700#comment-13065700
 ] 

Michael Glavassevich commented on XERCESJ-1113:
-----------------------------------------------

Hi Ishara,

I've now had a chance to review your code. Good work!

A key piece which still needs to be implemented is ID type assignment [1]. That 
is making the type "ID" in the XML Infoset and/or PSVI. XMLAttributes has a 
setType() method which you can use for that purpose. Also, if the attribute 
already had a type an xml:id processor is required to check that its type is 
ID, otherwise it is required to report an error if the attribute had some other 
type. That's another thing your code should be handling. Other than that you're 
nearly done with writing the component. Once you have the function complete, I 
would suggest that you create some JUnit tests for testing it, fix bugs you may 
find while testing, write up the documentation for the xml:id feature (examples 
of feature documentation are here [2]) and clean-up the code (e.g. removing 
System.out.println() and e.printStackTrace()) if you still have time.

Thanks.

[1] http://www.w3.org/TR/xml-id/#dt-id-assignment
[2] http://xerces.apache.org/xerces2-j/features.html

> [GSoC]: Support for xml:id
> --------------------------
>
>                 Key: XERCESJ-1113
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1113
>             Project: Xerces2-J
>          Issue Type: New Feature
>          Components: XInclude 1.0
>    Affects Versions: 2.7.1
>         Environment: All
>            Reporter: George Cristian Bina
>            Assignee: Ishara Karunarathna
>              Labels: gsoc2011
>         Attachments: xmlIDHandler.zip
>
>
> Hi,
> The XInclude ID support should handle xml:id. This is useful for instance 
> with DocBook or TEI that use Relax NG schemas for validation and also need 
> XInclude support.
> Here it is a patch that adds support for handling xml:id attributes as 
> attributes of ID type.
> Index: 
> C:/george/workspace/xerces/src/org/apache/xerces/xpointer/ShortHandPointer.java
> ===================================================================
> --- 
> C:/george/workspace/xerces/src/org/apache/xerces/xpointer/ShortHandPointer.java
>    (revision 344362)
> +++ 
> C:/george/workspace/xerces/src/org/apache/xerces/xpointer/ShortHandPointer.java
>    (working copy)
> @@ -162,6 +162,17 @@
>              }
>          }
>          
> +        if (normalizedValue == null && attributes != null) {
> +             // Try to see if we can get an xml:id
> +             for (int i = 0; i < attributes.getLength(); i++) {
> +                     if ("xml".equals(attributes.getPrefix(i)) && 
> +                                     
> "id".equals(attributes.getLocalName(i))) {
> +                             normalizedValue = attributes.getValue(i);
> +                             break;
> +                     }
> +             }               
> +        }
> +        
>          if (normalizedValue != null
>                  && normalizedValue.equals(fShortHandPointer)) {
>              return true;
> Best Regards,
> George

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: j-dev-h...@xerces.apache.org

Reply via email to