Beispiel #1
0
  /**
   * Receive notification of the start of an xsl:output element.
   *
   * @param handler The calling StylesheetHandler/TemplatesBuilder.
   * @param uri The Namespace URI, or the empty string if the element has no Namespace URI or if
   *     Namespace processing is not being performed.
   * @param localName The local name (without prefix), or the empty string if Namespace processing
   *     is not being performed.
   * @param rawName The raw XML 1.0 name (with prefix), or the empty string if raw names are not
   *     available.
   * @param attributes The attributes attached to the element. If there are no attributes, it shall
   *     be an empty Attributes object.
   * @throws org.xml.sax.SAXException
   */
  public void startElement(
      StylesheetHandler handler,
      String uri,
      String localName,
      String rawName,
      Attributes attributes)
      throws org.xml.sax.SAXException {
    // Hmmm... for the moment I don't think I'll have default properties set for this. -sb
    m_outputProperties = new OutputProperties();

    m_outputProperties.setDOMBackPointer(handler.getOriginatingNode());
    m_outputProperties.setLocaterInfo(handler.getLocator());
    m_outputProperties.setUid(handler.nextUid());
    setPropertiesFromAttributes(handler, rawName, attributes, this);

    // Access this only from the Hashtable level... we don't want to
    // get default properties.
    String entitiesFileName =
        (String) m_outputProperties.getProperties().get(OutputPropertiesFactory.S_KEY_ENTITIES);

    if (null != entitiesFileName) {
      try {
        String absURL =
            SystemIDResolver.getAbsoluteURI(entitiesFileName, handler.getBaseIdentifier());
        m_outputProperties.getProperties().put(OutputPropertiesFactory.S_KEY_ENTITIES, absURL);
      } catch (TransformerException te) {
        handler.error(te.getMessage(), te);
      }
    }

    handler.getStylesheet().setOutput(m_outputProperties);

    ElemTemplateElement parent = handler.getElemTemplateElement();
    parent.appendChild(m_outputProperties);

    m_outputProperties = null;
  }
Beispiel #2
0
 /**
  * Set the indent property from the attribute value.
  *
  * @see javax.xml.transform.OutputKeys#INDENT
  * @param newValue non-null reference to processed attribute value.
  */
 public void setIndent(boolean newValue) {
   m_outputProperties.setBooleanProperty(OutputKeys.INDENT, newValue);
 }
Beispiel #3
0
 /**
  * Set the encoding property from the attribute value.
  *
  * @see javax.xml.transform.OutputKeys#ENCODING
  * @param newValue non-null reference to processed attribute value.
  */
 public void setEncoding(String newValue) {
   m_outputProperties.setProperty(OutputKeys.ENCODING, newValue);
 }
Beispiel #4
0
 /**
  * Set the doctype-system property from the attribute value.
  *
  * @see javax.xml.transform.OutputKeys#DOCTYPE_SYSTEM
  * @param newValue non-null reference to processed attribute value.
  */
 public void setDoctypeSystem(String newValue) {
   m_outputProperties.setProperty(OutputKeys.DOCTYPE_SYSTEM, newValue);
 }
Beispiel #5
0
 /**
  * Set the doctype-public property from the attribute value.
  *
  * @see javax.xml.transform.OutputKeys#DOCTYPE_PUBLIC
  * @param newValue non-null reference to processed attribute value.
  */
 public void setDoctypePublic(String newValue) {
   m_outputProperties.setProperty(OutputKeys.DOCTYPE_PUBLIC, newValue);
 }
Beispiel #6
0
 /**
  * Set the cdata-section-elements property from the attribute value.
  *
  * @see javax.xml.transform.OutputKeys#CDATA_SECTION_ELEMENTS
  * @param newValue non-null reference to processed attribute value.
  */
 public void setCdataSectionElements(java.util.Vector newValue) {
   m_outputProperties.setQNameProperties(OutputKeys.CDATA_SECTION_ELEMENTS, newValue);
 }
Beispiel #7
0
 /**
  * Set a foreign property from the attribute value.
  *
  * @param newValue non-null reference to attribute value.
  */
 public void setForeignAttr(
     String attrUri, String attrLocalName, String attrRawName, String attrValue) {
   QName key = new QName(attrUri, attrLocalName);
   m_outputProperties.setProperty(key, attrValue);
 }
Beispiel #8
0
 /**
  * Set a foreign property from the attribute value.
  *
  * @param newValue non-null reference to attribute value.
  */
 public void addLiteralResultAttribute(
     String attrUri, String attrLocalName, String attrRawName, String attrValue) {
   QName key = new QName(attrUri, attrLocalName);
   m_outputProperties.setProperty(key, attrValue);
 }
Beispiel #9
0
 /**
  * Set the version property from the attribute value.
  *
  * @see javax.xml.transform.OutputKeys#VERSION
  * @param newValue non-null reference to processed attribute value.
  */
 public void setVersion(String newValue) {
   m_outputProperties.setProperty(OutputKeys.VERSION, newValue);
 }
Beispiel #10
0
 /**
  * Set the standalone property from the attribute value.
  *
  * @see javax.xml.transform.OutputKeys#STANDALONE
  * @param newValue processed attribute value.
  */
 public void setStandalone(boolean newValue) {
   m_outputProperties.setBooleanProperty(OutputKeys.STANDALONE, newValue);
 }
Beispiel #11
0
 /**
  * Set the omit-xml-declaration property from the attribute value.
  *
  * @see javax.xml.transform.OutputKeys#OMIT_XML_DECLARATION
  * @param newValue processed attribute value.
  */
 public void setOmitXmlDeclaration(boolean newValue) {
   m_outputProperties.setBooleanProperty(OutputKeys.OMIT_XML_DECLARATION, newValue);
 }
Beispiel #12
0
 /**
  * Set the method property from the attribute value.
  *
  * @see javax.xml.transform.OutputKeys#METHOD
  * @param newValue non-null reference to processed attribute value.
  */
 public void setMethod(org.apache.xml.utils.QName newValue) {
   m_outputProperties.setQNameProperty(OutputKeys.METHOD, newValue);
 }
Beispiel #13
0
 /**
  * Set the media type property from the attribute value.
  *
  * @see javax.xml.transform.OutputKeys#MEDIA_TYPE
  * @param newValue non-null reference to processed attribute value.
  */
 public void setMediaType(String newValue) {
   m_outputProperties.setProperty(OutputKeys.MEDIA_TYPE, newValue);
 }