jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sh...@apache.org
Subject cvs commit: jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tag/common XmlSetTag.java
Date Wed, 21 Nov 2001 02:12:32 GMT
shawn       01/11/20 18:12:32

  Modified:    jsptl/conf x.tld
               jsptl/src/org/apache/taglibs/jsptl/tag/common XmlSetTag.java
  Added:       jsptl/examples/web/xml Transform.jsp
  Log:
  Minor changes.
  
  Revision  Changes    Path
  1.4       +40 -1     jakarta-taglibs/jsptl/conf/x.tld
  
  Index: x.tld
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/jsptl/conf/x.tld,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- x.tld	2001/11/21 01:19:10	1.3
  +++ x.tld	2001/11/21 02:12:32	1.4
  @@ -205,6 +205,46 @@
     </tag>
   
     <tag>
  +    <name>transform</name>
  +    <tag-class>org.apache.taglibs.jsptl.tag.jx.XmlTransformTag</tag-class>
  +    <body-content>JSP</body-content>
  +    <description>
  +	Conducts a transformation given a source XML document
  +	and an XSLT stylesheet (or Transformer object)
  +    </description>
  +    <attribute>
  +        <name>var</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
  +    <attribute>
  +        <name>result</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
  +    <attribute>
  +        <name>source</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
  +    <attribute>
  +        <name></name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
  +    <attribute>
  +	<name>xslt</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
  +    <attribute>
  +        <name>transformer</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
  +  </tag>
  +
  +  <tag>
       <name>transformer</name>
       <tag-class>org.apache.taglibs.jsptl.tag.jx.XmlTransformerTag</tag-class>
       <body-content>JSP</body-content>
  @@ -222,7 +262,6 @@
           <rtexprvalue>false</rtexprvalue>
       </attribute>
     </tag>
  -
   
     <tag>
       <name>when</name>
  
  
  
  1.1                  jakarta-taglibs/jsptl/examples/web/xml/Transform.jsp
  
  Index: Transform.jsp
  ===================================================================
  <%@ taglib prefix="jx" uri="http://java.sun.com/jsptl/ea/jx" %>
  <%@ taglib prefix="x" uri="http://java.sun.com/jsptl/ea/x" %>
  
  <html>
  <head>
    <title>JSPTL: XML Support -- Transform</title>
  </head>
  <body bgcolor="#FFFFFF">
  <h3>Parse / Expr</h3>
  
  <jx:set var="xml">
    <a><b>header!</b></a>
  </jx:set>
  
  <jx:set var="xsl">
    <?xml version="1.0"?>
    <xsl:stylesheet
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  
    <xsl:template match="text()">
      <h1><xsl:value-of select="."/></h1>
    </xsl:template>
  
    </xsl:stylesheet>
  </jx:set>
  
  <x:transform source="$xml" xslt="$xsl"/>
  
  <hr />
  
  <x:transform source="$xml" xslt="$xsl" var="doc"/>
  <x:expr select="$doc//h1"/>
  
  <hr />
  
  </body>
  </html>
  
  
  
  1.3       +3 -3      jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tag/common/XmlSetTag.java
  
  Index: XmlSetTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/jsptl/src/org/apache/taglibs/jsptl/tag/common/XmlSetTag.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XmlSetTag.java	2001/11/19 06:35:11	1.2
  +++ XmlSetTag.java	2001/11/21 02:12:32	1.3
  @@ -69,7 +69,7 @@
       //*********************************************************************
       // Internal state
   
  -    private String select;                       // tag attribute
  +    private String select;                    // tag attribute
       private String var;                       // tag attribute
   
       //*********************************************************************
  @@ -98,8 +98,8 @@
       public int doStartTag() throws JspException {
           try {
   	    XPathUtil xu = new XPathUtil(pageContext);
  -	    org.w3c.dom.Node result = 
  -		xu.selectSingleNode(XPathUtil.getContext(this), select);
  +	    Object result = 
  +		xu.selectNodes(XPathUtil.getContext(this), select);
   	    pageContext.setAttribute(var, result);
   	    return SKIP_BODY;
           } catch (org.saxpath.SAXPathException ex) {
  
  
  

--
To unsubscribe, e-mail:   <mailto:taglibs-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-dev-help@jakarta.apache.org>


Mime
View raw message