org.apache.cocoon.xml
Class XMLBaseSupport
java.lang.Object
org.apache.cocoon.xml.XMLBaseSupport
public class XMLBaseSupport
- extends Object
Helper class for handling xml:base attributes.
Usage:
- set location of the containing document by calling
setDocumentLocation(String)
.
This is usually done when getting setDocumentLocator SAX event.
- forward each startElement and endElement event to this object.
- to resolve a relative URL against the current base, call
makeAbsolute(String)
.
External entities are not yet taken into account when determing the current base.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
XMLBaseSupport
public XMLBaseSupport(SourceResolver resolver,
Logger logger)
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
getCurrentBase
public String getCurrentBase()
- Returns the base URI currently in effect, or null if unknown.
Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.