Class XMLToVinci
java.lang.Object
org.apache.vinci.transport.document.XMLToVinci
Class for parsing an XML document and representing it using any of the various jVinci-compatible
document models.
-
Method Summary
Modifier and TypeMethodDescriptionstatic AFrame
Convert the XML document (provided as a Reader) to the AFrame document model.static Transportable
xmlToTransportable
(Reader r, Transportable empty) Populate the empty document with the XML yielded by the provided reader.static VinciFrame
Convert the XML document (provided as a Reader) to a VinciFrame document model.
-
Method Details
-
xmlToTransportable
public static Transportable xmlToTransportable(Reader r, Transportable empty) throws ServiceException Populate the empty document with the XML yielded by the provided reader.- Parameters:
r
- A reader providing the XML to populate the empty document.empty
- An empty document to be populated.- Returns:
- -
- Throws:
ServiceException
- if there is a parse error.
-
xmlToVinciFrame
Convert the XML document (provided as a Reader) to a VinciFrame document model. Throws ServiceException if the XML parser reports any error. WARNING: This method will silently ignore any attributes or processing instructions within the document since VinciFrame cannot represent them. Consider using AFrame if attribute support is required. This implementation of xmlToVinciFrame uses apache SAX parser directly. It should be faster, and it should be tolerant of undeclared namespaces, unlike the previous impl.- Parameters:
r
- A reader providing the XML to convert.- Returns:
- -
- Throws:
ServiceException
- if there is a parse error.
-
xmlToAFrame
Convert the XML document (provided as a Reader) to the AFrame document model. Throws ServiceException if the XML parser reports any error. WARNING: This method will silently ignore any processing instructions within the document since AFrame cannot represent them.- Parameters:
r
- A reader providing the XML to convert.- Returns:
- -
- Throws:
ServiceException
- if there is a parse error.
-