Package com.lightcrafts.utils.xml

Examples of com.lightcrafts.utils.xml.ElementFilter


     */
    public static Element getLZNDescription( Element rdfElement,
                                             boolean create )
        throws IOException
    {
        final ElementFilter filter =
            new ElementFilter(
                XMP_RDF_PREFIX + ":Description",
                "xmlns:lzn", Application.LznNamespace
            );
        Element lznDescElement =
            (Element)XMLUtil.getFirstChildOf( rdfElement, filter );
View Full Code Here


     * doesn't contain an <code>rdf:RDF</code> element.
     */
    public static Element getRDFElementOf( Document xmpDoc ) {
        return (Element)XMLUtil.getFirstChildOf(
            xmpDoc.getDocumentElement(),
            new ElementFilter( XMP_RDF_PREFIX + ":RDF" )
        );
    }
View Full Code Here

        final Element oldRDFElement = getRDFElementOf( oldXMPDoc );
        //
        // Find the rdf element containing the metadata for the given
        // directory.
        //
        final ElementFilter dirFilter = new ElementFilter(
            XMP_RDF_PREFIX + ":Description", "xmlns:" + dirPrefix, dirNS
        );
        Node newRDFDirElement =
            XMLUtil.getFirstChildOf( newRDFElement, dirFilter );
        final Element oldRDFDirElement =
View Full Code Here

     * @param parent The {@link XmlNode} to add child nodes to.
     */
    public ImageExportOptionXMLReader( Element parent ) throws IOException {
        final Node node = XMLUtil.getFirstChildOf(
            parent,
            new ElementFilter( ImageExportOptionXMLWriter.ExportOptionsTag )
        );
        if ( node == null )
            throw new XMLException( ImageExportOptionXMLWriter.ExportOptionsTag + "\" expected" );
        m_parent = (Element)node;
    }
View Full Code Here

     * @param o
     * @throws IOException
     */
    private void readImpl( ImageExportOption o ) throws IOException {
        final Node child = XMLUtil.getFirstChildOf(
            m_parent, new ElementFilter( o.getName() )
        );
        if ( child == null )
            return;
        final String value = ((Element)child).getAttribute( "value" );
        if ( value.length() == 0 )
View Full Code Here

            return false;

        ////////// Parse the version number ///////////////////////////////////

        final Element number = (Element)XMLUtil.getFirstChildOf(
            version, new ElementFilter( "number" )
        );
        if ( number == null )
            return false;
        m_updateVersion = XMLUtil.getTextOfFirstTextChildOf( number );

        ////////// Parse the revision number //////////////////////////////////

        final Element revision = (Element)XMLUtil.getFirstChildOf(
            version, new ElementFilter( "revision" )
        );
        if ( revision == null )
            return false;
        final String updateRevision =
            XMLUtil.getTextOfFirstTextChildOf( revision );
        try {
            m_updateRevision = Integer.parseInt( updateRevision );
        }
        catch ( NumberFormatException e ) {
            return false;
        }

        ////////// Parse the URL //////////////////////////////////////////////

        final Element url = (Element)XMLUtil.getFirstChildOf(
            version, new ElementFilter( "url" )
        );
        if ( url == null )
            return false;
        m_updateURL = XMLUtil.getTextOfFirstTextChildOf( url );
View Full Code Here

TOP

Related Classes of com.lightcrafts.utils.xml.ElementFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.