Package com.adobe.dp.epub.opf

Examples of com.adobe.dp.epub.opf.ResourceRef


      id = null;
    } else {
      path = href.substring(0, hash);
      id = href.substring(hash + 1);
    }
    ResourceRef resref = epub.getResourceRef(path);
    if( resref == null )
      return null;
    return resref.getXRef(id);
  }
View Full Code Here


    int hash = url.indexOf('#');
    if (hash < 0)
      return new ResourceURL(owner, owner.getPublication().getResourceRef(url));
    String fragment = url.substring(hash + 1);
    url = url.substring(0, hash);
    ResourceRef ref = owner.getPublication().getResourceRef(url);
    return new ResourceURL(owner, ref.getXRef(fragment));
  }
View Full Code Here

  void setElementId(Element e, String id) {
    if (e.id != null)
      idMap.remove(e.id);
    Element old = (Element) idMap.put(id, e);
    ResourceRef ref = resource.getResourceRef();
    XRef xref = ref.takeOverUnresolvedXRef(id);
    if (xref != null) {
      xref.targetElement = e;
    }
    e.id = id;
    if (old != null) {
View Full Code Here

  public void cascadeStyles() {
    CascadeEngine engine = new CascadeEngine();
    Iterator s = styleResources();
    while (s.hasNext()) {
      ResourceRef ref = (ResourceRef) s.next();
      Resource r = ref.getResource();
      if (r instanceof StyleResource) {
        StyleResource sr = (StyleResource) r;
        Stylesheet stylesheet = sr.getStylesheet();
        if (stylesheet != null) {
          CSSStylesheet css = stylesheet.getCSS();
View Full Code Here

    ser.startDocument("1.0", "UTF-8");
    boolean isSVG = resource.getMediaType().equals("image/svg+xml");
    if (isSVG) {
      Iterator s = styleResources();
      while (s.hasNext()) {
        ResourceRef sr = (ResourceRef) s.next();
        String href = resource.makeReference(sr.getResourceName(), null);
        ser.processingInstruction("xml-stylesheet", "href=\"" + href + "\" type=\"text/css\"");
      }
      getBody().serialize(ser);
    } else {
      ser.startElement(xhtmlns, "html", null, true);
      ser.newLine();
      ser.startElement(xhtmlns, "head", null, false);
      ser.newLine();
      ser.startElement(xhtmlns, "title", null, false);
      ser.endElement(xhtmlns, "title");
      ser.newLine();
      Iterator s = styleResources();
      while (s.hasNext()) {
        ResourceRef sr = (ResourceRef) s.next();
        String href = resource.makeReference(sr.getResourceName(), null);
        SMapImpl attr = new SMapImpl();
        attr.put(null, "rel", "stylesheet");
        attr.put(null, "type", "text/css");
        attr.put(null, "href", href);
        ser.startElement(xhtmlns, "link", attr, false);
View Full Code Here

TOP

Related Classes of com.adobe.dp.epub.opf.ResourceRef

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.