Java Code Examples for org.w3c.dom.Document#getUserData()

The following examples show how to use org.w3c.dom.Document#getUserData() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LocationAwareContentHandlerTest.java    From windup with Eclipse Public License 1.0 5 votes vote down vote up
@Test
public void doctypeInformationTest() throws IOException, SAXException
{
    Document document = LocationAwareXmlReader.readXML(new FileInputStream(new File(SIMPLE_DOCTYPE_XML_PATH)));
    LocationAwareContentHandler.Doctype docType = (LocationAwareContentHandler.Doctype) document
                .getUserData(LocationAwareContentHandler.DOCTYPE_KEY_NAME);
    Assert.assertEquals("http://www.objectweb.org/jonas/dtds/jonas-web-app_3_1.dtd",docType.getSystemId());
    Assert.assertEquals("-//ObjectWeb//DTD JOnAS Web App 3.1//EN",docType.getPublicId());
}
 
Example 2
Source File: WidgetDocumentInfo.java    From scipio-erp with Apache License 2.0 4 votes vote down vote up
public static WidgetDocumentInfo retrieve(Document document) {
    return (WidgetDocumentInfo) document.getUserData(DOCUMENT_USER_DATA_KEY);
}
 
Example 3
Source File: LocationAwareXmlReader.java    From windup with Eclipse Public License 1.0 4 votes vote down vote up
public static Set<String> getNamespaces(Document doc)
{
    return (Set<String>) doc.getUserData(LocationAwareContentHandler.NAMESPACE_KEY_NAME);
}