< prev index next >

src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/LoadDocument.java

Print this page


   1 /*
   2  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
   3  * @LastModified: Sep 2017
   4  */
   5 /*
   6  * Licensed to the Apache Software Foundation (ASF) under one or more
   7  * contributor license agreements.  See the NOTICE file distributed with
   8  * this work for additional information regarding copyright ownership.
   9  * The ASF licenses this file to You under the Apache License, Version 2.0
  10  * (the "License"); you may not use this file except in compliance with
  11  * the License.  You may obtain a copy of the License at
  12  *
  13  *      http://www.apache.org/licenses/LICENSE-2.0
  14  *
  15  * Unless required by applicable law or agreed to in writing, software
  16  * distributed under the License is distributed on an "AS IS" BASIS,
  17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18  * See the License for the specific language governing permissions and
  19  * limitations under the License.
  20  */
  21 
  22 package com.sun.org.apache.xalan.internal.xsltc.dom;
  23 
  24 import com.sun.org.apache.xalan.internal.XalanConstants;
  25 import com.sun.org.apache.xalan.internal.xsltc.DOM;
  26 import com.sun.org.apache.xalan.internal.xsltc.DOMCache;
  27 import com.sun.org.apache.xalan.internal.xsltc.DOMEnhancedForDTM;
  28 import com.sun.org.apache.xalan.internal.xsltc.TransletException;
  29 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
  30 import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
  31 import com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl;
  32 import com.sun.org.apache.xml.internal.dtm.DTM;
  33 import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
  34 import com.sun.org.apache.xml.internal.dtm.DTMManager;
  35 import com.sun.org.apache.xml.internal.dtm.ref.EmptyIterator;
  36 import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
  37 import java.io.FileNotFoundException;
  38 import javax.xml.transform.stream.StreamSource;
  39 import jdk.xml.internal.SecuritySupport;
  40 
  41 /**
  42  * @author Morten Jorgensen

  43  */
  44 public final class LoadDocument {
  45 
  46     private static final String NAMESPACE_FEATURE =
  47        "http://xml.org/sax/features/namespaces";
  48 
  49     /**
  50      * Interprets the arguments passed from the document() function (see
  51      * com/sun/org/apache/xalan/internal/xsltc/compiler/DocumentCall.java) and returns an
  52      * iterator containing the requested nodes. Builds a union-iterator if
  53      * several documents are requested.
  54      * 2 arguments arg1 and arg2.  document(Obj, node-set) call
  55      */
  56     public static DTMAxisIterator documentF(Object arg1, DTMAxisIterator arg2,
  57                             String xslURI, AbstractTranslet translet, DOM dom)
  58     throws TransletException {
  59         String baseURI = null;
  60         final int arg2FirstNode = arg2.next();
  61         if (arg2FirstNode == DTMAxisIterator.END) {
  62             //  the second argument node-set is empty


   1 /*
   2  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.

   3  */
   4 /*
   5  * Licensed to the Apache Software Foundation (ASF) under one or more
   6  * contributor license agreements.  See the NOTICE file distributed with
   7  * this work for additional information regarding copyright ownership.
   8  * The ASF licenses this file to You under the Apache License, Version 2.0
   9  * (the "License"); you may not use this file except in compliance with
  10  * the License.  You may obtain a copy of the License at
  11  *
  12  *      http://www.apache.org/licenses/LICENSE-2.0
  13  *
  14  * Unless required by applicable law or agreed to in writing, software
  15  * distributed under the License is distributed on an "AS IS" BASIS,
  16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17  * See the License for the specific language governing permissions and
  18  * limitations under the License.
  19  */
  20 
  21 package com.sun.org.apache.xalan.internal.xsltc.dom;
  22 
  23 import com.sun.org.apache.xalan.internal.XalanConstants;
  24 import com.sun.org.apache.xalan.internal.xsltc.DOM;
  25 import com.sun.org.apache.xalan.internal.xsltc.DOMCache;
  26 import com.sun.org.apache.xalan.internal.xsltc.DOMEnhancedForDTM;
  27 import com.sun.org.apache.xalan.internal.xsltc.TransletException;
  28 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
  29 import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
  30 import com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl;
  31 import com.sun.org.apache.xml.internal.dtm.DTM;
  32 import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
  33 import com.sun.org.apache.xml.internal.dtm.DTMManager;
  34 import com.sun.org.apache.xml.internal.dtm.ref.EmptyIterator;
  35 import com.sun.org.apache.xml.internal.utils.SystemIDResolver;
  36 import java.io.FileNotFoundException;
  37 import javax.xml.transform.stream.StreamSource;
  38 import jdk.xml.internal.SecuritySupport;
  39 
  40 /**
  41  * @author Morten Jorgensen
  42  * @LastModified: Sep 2017
  43  */
  44 public final class LoadDocument {
  45 
  46     private static final String NAMESPACE_FEATURE =
  47        "http://xml.org/sax/features/namespaces";
  48 
  49     /**
  50      * Interprets the arguments passed from the document() function (see
  51      * com/sun/org/apache/xalan/internal/xsltc/compiler/DocumentCall.java) and returns an
  52      * iterator containing the requested nodes. Builds a union-iterator if
  53      * several documents are requested.
  54      * 2 arguments arg1 and arg2.  document(Obj, node-set) call
  55      */
  56     public static DTMAxisIterator documentF(Object arg1, DTMAxisIterator arg2,
  57                             String xslURI, AbstractTranslet translet, DOM dom)
  58     throws TransletException {
  59         String baseURI = null;
  60         final int arg2FirstNode = arg2.next();
  61         if (arg2FirstNode == DTMAxisIterator.END) {
  62             //  the second argument node-set is empty


< prev index next >