mmidy       01/07/12 09:18:52

  Modified:    java/src/org/apache/xml/dtm/ref/sax2dtm SAX2DTM.java
  Log:
  Check if locator property is set before trying to use locator fields
  
  Revision  Changes    Path
  1.10      +10 -6     
xml-xalan/java/src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
  
  Index: SAX2DTM.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- SAX2DTM.java      2001/07/11 04:00:15     1.9
  +++ SAX2DTM.java      2001/07/12 16:18:45     1.10
  @@ -2239,11 +2239,15 @@
   
     public SourceLocator getSourceLocatorFor(int node)
     {
  -    node = node & ExpandedNameTable.MASK_NODEHANDLE;
  -    
  -    return new NodeLocator(null,
  -                           m_sourceSystemId.elementAt(node),
  -                           m_sourceLine.elementAt(node),
  -                           m_sourceColumn.elementAt(node));
  +    if (m_useSourceLocationProperty)
  +    {
  +      node = node & ExpandedNameTable.MASK_NODEHANDLE;
  +      
  +      return new NodeLocator(null,
  +                             m_sourceSystemId.elementAt(node),
  +                             m_sourceLine.elementAt(node),
  +                             m_sourceColumn.elementAt(node));
  +    }
  +    return null;
     }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to