Package com.adobe.epubcheck.xml

Examples of com.adobe.epubcheck.xml.XMLElement


    {
      HandlerUtil.checkXMLVersion(parser);
      checkedUnsupportedXMLVersion = true;
    }

    XMLElement e = parser.getCurrentElement();
    String name = e.getName();

    if (name.equals("smil"))
    {
      vocabs = VocabUtil.parsePrefixDeclaration(e.getAttributeNS(EpubConstants.EpubTypeNamespaceUri, "prefix"), RESERVED_VOCABS,
          KNOWN_VOCAB_URIS, DEFAULT_VOCAB_URIS, report,
          new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()));
    } else if (name.equals("seq"))
    {
      processSeq(e);
    } else if (name.equals("text"))
    {
      processSrc(e);
    } else if (name.equals("audio"))
    {
      processRef(e.getAttribute("src"), XRefChecker.RT_AUDIO);
    } else if (name.equals("body") || name.equals("par"))
    {
      checkType(e.getAttributeNS(EpubConstants.EpubTypeNamespaceUri, "type"));
    }
  }
View Full Code Here


    {
      HandlerUtil.checkXMLVersion(parser);
      checkedUnsupportedXmlVersion = true;
    }

    XMLElement e = parser.getCurrentElement();
    String ns = e.getNamespace();
    String name = e.getName();
    String id = e.getAttribute("id");
    if (ns.equals("http://www.daisy.org/z3986/2005/dtbook/"))
    {
      // link@href, a@href, img@src
      String uri = null;
      /*
          * This section checks to see if the references used are registered
          * schema-types and whether they point to external resources. The
          * resources are only allowed to be external if the attribute
          * "external" is set to true.
          */
      if (name.equals("a"))
      {
        uri = e.getAttribute("href");
        String external = e.getAttribute("external");
        if (uri != null && external.equals("true"))
        {
          if (OPSHandler.isRegisteredSchemeType(uri))
          {
            uri = null;
          }
          else if (uri.indexOf(':') > 0)
          {
            parser.getReport().message(MessageId.OPF_021,
                new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()),
                uri);
            uri = null;
          }
        }
      }
      else if (name.equals("link"))
      {
        uri = e.getAttribute("href");
      }
      else if (name.equals("img"))
      {
        uri = e.getAttribute("src");
      }
      if (uri != null)
      {
        //TODO check if dtbook uses xml:base of so set third param
        uri = PathUtil.resolveRelativeReference(path, uri, null);
View Full Code Here

    {
      HandlerUtil.checkXMLVersion(parser);
      checkedUnsupportedXmlVersion = true;
    }

    XMLElement e = parser.getCurrentElement();
    String ns = e.getNamespace();
    String name = e.getName();
    if (ns.equals("http://www.daisy.org/z3986/2005/ncx/") && name.equals("content"))
    {
      String href = e.getAttribute("src");
      if (href != null)
      {
        href = PathUtil.resolveRelativeReference(path, href, null);
        if (href.startsWith("http"))
        {
          parser.getReport().info(path, FeatureEnum.REFERENCE, href);
        }
        xrefChecker.registerReference(path, parser.getLineNumber(),
            parser.getColumnNumber(), href,
            XRefChecker.RT_HYPERLINK);
      }
      else if ("meta".equals(name))
      {
        String metaName = e.getAttribute("name");
        if ("dtb:uid".equals(metaName))
        {
          String metaContent = e.getAttribute("content");
          if (metaContent != null)
          {
            uid = metaContent;
          }
        }
View Full Code Here

TOP

Related Classes of com.adobe.epubcheck.xml.XMLElement

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.