Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-1113

[GSoC]: Support for xml:id

Agile BoardAttach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.7.1
    • None
    • XInclude 1.0
    • All

    Description

      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) &&
      + "id".equals(attributes.getLocalName))

      { + normalizedValue = attributes.getValue(i); + break; + }

      + }
      + }
      +
      if (normalizedValue != null
      && normalizedValue.equals(fShortHandPointer)) {
      return true;

      Best Regards,
      George

      Attachments

        1. XmlIDhandler(v1.0).zip
          28 kB
          Ishara Karunarathna
        2. xmlIDHandler.zip
          21 kB
          Ishara Karunarathna

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            ishara Ishara Karunarathna
            george@sync.ro George Cristian Bina

            Dates

              Created:
              Updated:

              Slack

                Issue deployment