< prev index next >

src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/StylesheetPIHandler.java

Print this page


   1 /*
   2  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
   3  * @LastModified: Oct 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.xml.internal.utils;
  23 
  24 import java.util.ArrayList;
  25 import java.util.List;
  26 import java.util.StringTokenizer;
  27 import javax.xml.transform.Source;
  28 import javax.xml.transform.TransformerException;
  29 import javax.xml.transform.URIResolver;
  30 import javax.xml.transform.sax.SAXSource;
  31 import org.xml.sax.Attributes;
  32 import org.xml.sax.InputSource;
  33 import org.xml.sax.helpers.DefaultHandler;
  34 
  35 /**
  36  * Search for the xml-stylesheet processing instructions in an XML document.
  37  * @see <a href="http://www.w3.org/TR/xml-stylesheet/">
  38  * Associating Style Sheets with XML documents, Version 1.0</a>


  39  */
  40 public class StylesheetPIHandler extends DefaultHandler
  41 {
  42   /** The baseID of the document being processed.  */
  43   String m_baseID;
  44 
  45   /** The desired media criteria. */
  46   String m_media;
  47 
  48   /** The desired title criteria.  */
  49   String m_title;
  50 
  51   /** The desired character set criteria.   */
  52   String m_charset;
  53 
  54   /** A list of SAXSource objects that match the criteria.  */
  55   List<Source> m_stylesheets = new ArrayList<>();
  56 
  57   // Add code to use a URIResolver. Patch from Dmitri Ilyin.
  58 


   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.xml.internal.utils;
  22 
  23 import java.util.ArrayList;
  24 import java.util.List;
  25 import java.util.StringTokenizer;
  26 import javax.xml.transform.Source;
  27 import javax.xml.transform.TransformerException;
  28 import javax.xml.transform.URIResolver;
  29 import javax.xml.transform.sax.SAXSource;
  30 import org.xml.sax.Attributes;
  31 import org.xml.sax.InputSource;
  32 import org.xml.sax.helpers.DefaultHandler;
  33 
  34 /**
  35  * Search for the xml-stylesheet processing instructions in an XML document.
  36  * @see <a href="http://www.w3.org/TR/xml-stylesheet/">
  37  * Associating Style Sheets with XML documents, Version 1.0</a>
  38  *
  39  * @LastModified: Oct 2017
  40  */
  41 public class StylesheetPIHandler extends DefaultHandler
  42 {
  43   /** The baseID of the document being processed.  */
  44   String m_baseID;
  45 
  46   /** The desired media criteria. */
  47   String m_media;
  48 
  49   /** The desired title criteria.  */
  50   String m_title;
  51 
  52   /** The desired character set criteria.   */
  53   String m_charset;
  54 
  55   /** A list of SAXSource objects that match the criteria.  */
  56   List<Source> m_stylesheets = new ArrayList<>();
  57 
  58   // Add code to use a URIResolver. Patch from Dmitri Ilyin.
  59 


< prev index next >