Class RegistryImporter


  • public class RegistryImporter
    extends Object
    Author:
    Richard Jones This class provides the tools that registry importers might need to use. Basically some utility methods. And actually, although it says I am the author, really I ripped these methods off from other classes
    • Method Detail

      • getElementData

        public static String getElementData​(Node parentElement,
                                            String childName)
                                     throws TransformerException
        Get the CDATA of a particular element. For example, if the XML document contains:

        <foo><mimetype>application/pdf</mimetype></foo> passing this the foo node and mimetype will return application/pdf.

        Why this isn't a core part of the XML API I do not know...
        Parameters:
        parentElement - the element, whose child element you want the CDATA from
        childName - the name of the element you want the CDATA from
        Returns:
        the CDATA as a String
        Throws:
        TransformerException - if error
      • getRepeatedElementData

        public static String[] getRepeatedElementData​(Node parentElement,
                                                      String childName)
                                               throws TransformerException
        Get repeated CDATA for a particular element. For example, if the XML document contains:

        <foo> <bar>val1</bar> <bar>val2</bar> </foo> passing this the foo node and bar will return val1 and val2.

        Why this also isn't a core part of the XML API I do not know...
        Parameters:
        parentElement - the element, whose child element you want the CDATA from
        childName - the name of the element you want the CDATA from
        Returns:
        the CDATA as a String
        Throws:
        TransformerException - if error