org.apache.cocoon.xml
Class XMLBaseSupport

java.lang.Object
  extended byorg.apache.cocoon.xml.XMLBaseSupport

public class XMLBaseSupport
extends Object

Helper class for handling xml:base attributes.

Usage:

External entities are not yet taken into account when determing the current base.


Field Summary
static String XMLBASE_ATTRIBUTE
           
static String XMLBASE_NAMESPACE_URI
           
 
Constructor Summary
XMLBaseSupport(SourceResolver resolver, Log logger)
           
 
Method Summary
 void endElement(String namespaceURI, String localName, String qName)
           
 Source makeAbsolute(String spec)
          Makes the given path absolute based on the current base URL.
 void setDocumentLocation(String loc)
           
 void startElement(String namespaceURI, String localName, String qName, Attributes attrs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XMLBASE_NAMESPACE_URI

public static final String XMLBASE_NAMESPACE_URI
See Also:
Constant Field Values

XMLBASE_ATTRIBUTE

public static final String XMLBASE_ATTRIBUTE
See Also:
Constant Field Values
Constructor Detail

XMLBaseSupport

public XMLBaseSupport(SourceResolver resolver,
                      Log logger)
Method Detail

setDocumentLocation

public void setDocumentLocation(String loc)
                         throws SAXException
Throws:
SAXException

startElement

public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes attrs)
                  throws SAXException
Throws:
SAXException

endElement

public void endElement(String namespaceURI,
                       String localName,
                       String qName)

makeAbsolute

public Source makeAbsolute(String spec)
                    throws SAXException
Makes the given path absolute based on the current base URL. Do not forget to release the returned source object!

Parameters:
spec - any URL (relative or absolute, containing a scheme or not)
Throws:
SAXException


Copyright © 1999-2008 The Apache Software Foundation. All Rights Reserved.