Issue Details (XML | Word | Printable)

Key: XERCESJ-1113
Type: New Feature New Feature
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: George Cristian Bina
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Xerces2-J

Support for xml:id

Created: 15/Nov/05 11:24 PM   Updated: 09/Jan/06 03:36 PM
Return to search
Component/s: XInclude 1.0
Affects Version/s: 2.7.1
Fix Version/s: None

Time Tracking:
Not Specified

Environment: All


 Description  « Hide
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


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No changes have yet been made on this issue.