src/share/classes/org/jcp/xml/dsig/internal/dom/DOMURIDereferencer.java

Print this page




  94                 }
  95 
  96                 XMLSignatureInput result = new XMLSignatureInput(referencedElem);
  97                 if (!uri.substring(1).startsWith("xpointer(id(")) {
  98                     result.setExcludeComments(true);
  99                 }
 100 
 101                 result.setMIMEType("text/xml");
 102                 if (baseURI != null && baseURI.length() > 0) {
 103                     result.setSourceURI(baseURI.concat(uriAttr.getNodeValue()));
 104                 } else {
 105                     result.setSourceURI(uriAttr.getNodeValue());
 106                 }
 107                 return new ApacheNodeSetData(result);
 108             }
 109         }
 110 
 111         try {
 112             ResourceResolver apacheResolver =
 113                 ResourceResolver.getInstance(uriAttr, baseURI, secVal);
 114             XMLSignatureInput in = apacheResolver.resolve(uriAttr, baseURI);

 115             if (in.isOctetStream()) {
 116                 return new ApacheOctetStreamData(in);
 117             } else {
 118                 return new ApacheNodeSetData(in);
 119             }
 120         } catch (Exception e) {
 121             throw new URIReferenceException(e);
 122         }
 123     }
 124 }


  94                 }
  95 
  96                 XMLSignatureInput result = new XMLSignatureInput(referencedElem);
  97                 if (!uri.substring(1).startsWith("xpointer(id(")) {
  98                     result.setExcludeComments(true);
  99                 }
 100 
 101                 result.setMIMEType("text/xml");
 102                 if (baseURI != null && baseURI.length() > 0) {
 103                     result.setSourceURI(baseURI.concat(uriAttr.getNodeValue()));
 104                 } else {
 105                     result.setSourceURI(uriAttr.getNodeValue());
 106                 }
 107                 return new ApacheNodeSetData(result);
 108             }
 109         }
 110 
 111         try {
 112             ResourceResolver apacheResolver =
 113                 ResourceResolver.getInstance(uriAttr, baseURI, secVal);
 114             XMLSignatureInput in = apacheResolver.resolve(uriAttr,
 115                                                           baseURI, secVal);
 116             if (in.isOctetStream()) {
 117                 return new ApacheOctetStreamData(in);
 118             } else {
 119                 return new ApacheNodeSetData(in);
 120             }
 121         } catch (Exception e) {
 122             throw new URIReferenceException(e);
 123         }
 124     }
 125 }