Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.caucho.xsl
Class XslWriter

    java.lang.Object
      |
      +--java.io.Writer
            |
            +--com.caucho.xsl.XslWriter

public class XslWriter
extends java.io.Writer

Writer stream for generating stylesheet output.

Because XSL produces an XML tree, XslWriter contains extra methods for constructing the tree.

The writer methods, e.g. println, add to the current text node.

In addition, stylesheets can access variables through getPwd and getPage.

Fields inherited from class java.io.Writer
`lock`

Method Summary
`void` | `addCacheDepend(Path path)` Add a dependency to the result document.
`void` | `close()` close is meaningless for XslWriter.
`void` | `copyOf(java.lang.Object value)` Adds a deep copy of the node to the current node.
`boolean` | `disableEscaping(boolean disable)`
`void` | `flush()` flush is meaningless for XslWriter.
`java.lang.Object` | `getAttribute(java.lang.String name)` Returns the attribute with the given name.
`java.util.Iterator` | `getAttributeNames()` Lists the names of all the attributes.
`boolean` | `getDisableEscaping()`
`PageContext` | `getPage()` For XTP pages, returns the servlet page context.
`Path` | `getPwd()` Returns the current working directory.
`boolean` | `isFlagFirst(int id)` Implementation function so jsp:decl tags aren't repeated.
`void` | `popAttribute()` Sets the attribute value to the current text, and sets the current node to the parent.
`void` | `popComment()` Sets the comment data to the current text, and sets the current to the the parent.
`void` | `popCopy()` Pops the copy.
`void` | `popElement()` Makes the parent element the current node.
`Node` | `popFragment()` Returns the generated fragment.
`void` | `popPi()` Sets the PI data to the current text, and sets the current node to the parent.
`void` | `popText()` Pop the accumulated text to the DOM.
`void` | `print(boolean b)` Adds a boolean to the current text node.
`void` | `print(char ch)` Adds a character to the current text node.
`void` | `print(double d)` Adds a double to the current text node.
`void` | `print(float f)` Adds a float to the current text node.
`void` | `print(int i)` Adds an integer to the current text node.
`void` | `print(long l)` Adds an integer to the current text node.
`void` | `print(java.lang.Object o)` Adds an object to the current text node, converted by String.valueOf.
`void` | `print(java.lang.String string)` Adds a string to the current text node.
`void` | `println()` Adds a newline to the current text node.
`void` | `println(boolean b)` Adds a boolean to the current text node.
`void` | `println(char ch)` Adds a character to the current text node.
`void` | `println(double d)` Adds a double to the current text node.
`void` | `println(float f)` Adds a float to the current text node.
`void` | `println(int i)` Adds an integer to the current text node.
`void` | `println(long l)` Adds a long to the current text node.
`void` | `println(java.lang.Object o)` Adds an object to the current text node, converted by String.valueOf.
`void` | `println(java.lang.String s)` Adds a string to the current text node.
`void` | `pushAttribute(java.lang.String name)` Adds a new attribute with the given name to the current node, making the attribute the current node.
`void` | `pushAttribute(java.lang.String name, NamespaceContext namespace)` Adds a new attribute with the given name to the current node, making the attribute the current node.
`void` | `pushAttribute(java.lang.String prefix, java.lang.String local, java.lang.String url)` Adds a namespace-aware attribute to the current node, making the new attribute the current node.
`void` | `pushAttributeNs(java.lang.String name, java.lang.String url)` Adds a new attribute to the current node, making the new attribute the current node.
`void` | `pushComment()` Adds an empty comment to the current node, making the attribute the current node.
`void` | `pushCopy(Node copyNode)` Copies the node without attributes or children.
`void` | `pushElement(java.lang.String name)` Adds a new element to the current node, making the new element the current node.
`void` | `pushElement(java.lang.String name, NamespaceContext namespace)` Adds a new element to the current node, making the new element the current node.
`void` | `pushElement(java.lang.String prefix, java.lang.String local, java.lang.String url)` Adds a namespace-aware element to the current node, making the new element the current node.
`void` | `pushElementCopy(Node oldNode)` Adds a top-level copy of a node to the current node, making the new element the current node.
`void` | `pushElementNs(java.lang.String name, java.lang.String url)` Adds a new element to the current node, making the new element the current node.
`void` | `pushFragment()` Starts a fragment.
`void` | `pushPi(java.lang.String name)` Adds a new ProcessingInstruction node with the given name to the current node, making the PI the current node.
`void` | `removeAttribute(java.lang.String name)` removes the attribute with the given name.
`void` | `setAttribute(java.lang.String name, java.lang.Object value)` Sets the attribute with the given name.
`void` | `setLocation(java.lang.String filename, int line)`
`void` | `setNotCacheable()` Indicate that the result document is not cacheable.
`void` | `valueOf(java.lang.Object node)` Adds a the contents of the node to the current node.
`void` | `write(byte[] buf, int offset, int length)` Adds a byte buffer to the current text node.
`void` | `write(char[] buf, int offset, int length)` Adds a char buffer to the current text node.
`void` | `write(int ch)` Adds a byte to the current text node.

Methods inherited from class java.io.Writer
`write, write, write`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### setNotCacheable

    public void setNotCacheable()

  Indicate that the result document is not cacheable.

### addCacheDepend

    public void addCacheDepend(Path path)

  Add a dependency to the result document. When the result is checked for modification, this path will also be checked.

### getPwd

    public Path getPwd()

  Returns the current working directory.

### getPage

    public PageContext getPage()

  For XTP pages, returns the servlet page context. From the page context, the stylesheet can retrieve the ServletRequest and ServletResponse variables.

### isFlagFirst

    public boolean isFlagFirst(int id)

  Implementation function so jsp:decl tags aren't repeated.

### write

    public void write(int ch)

  Adds a byte to the current text node.
  Overrides:
    write in class java.io.Writer

### write

    public void write(byte[] buf,
                      int offset,
                      int length)

  Adds a byte buffer to the current text node.

### write

    public void write(char[] buf,
                      int offset,
                      int length)

  Adds a char buffer to the current text node.
  Overrides:
    write in class java.io.Writer

### print

    public void print(java.lang.String string)

  Adds a string to the current text node.

### print

    public void print(boolean b)

  Adds a boolean to the current text node.

### print

    public void print(char ch)

  Adds a character to the current text node.

### print

    public void print(int i)

  Adds an integer to the current text node.

### print

    public void print(long l)

  Adds an integer to the current text node.

### print

    public void print(float f)

  Adds a float to the current text node.

### print

    public void print(double d)

  Adds a double to the current text node.

### print

    public void print(java.lang.Object o)

  Adds an object to the current text node, converted by String.valueOf.

### println

    public void println()

  Adds a newline to the current text node.

### println

    public void println(boolean b)

  Adds a boolean to the current text node.

### println

    public void println(java.lang.String s)

  Adds a string to the current text node.

### println

    public void println(char ch)

  Adds a character to the current text node.

### println

    public void println(int i)

  Adds an integer to the current text node.

### println

    public void println(long l)

  Adds a long to the current text node.

### println

    public void println(double d)

  Adds a double to the current text node.

### println

    public void println(float f)

  Adds a float to the current text node.

### println

    public void println(java.lang.Object o)

  Adds an object to the current text node, converted by String.valueOf.

### flush

    public void flush()

  flush is meaningless for XslWriter. It's only added to conform to Writer.
  Overrides:
    flush in class java.io.Writer

### close

    public void close()

  close is meaningless for XslWriter. It's only added to conform to Writer.
  Overrides:
    close in class java.io.Writer

### getDisableEscaping

    public boolean getDisableEscaping()

### disableEscaping

    public boolean disableEscaping(boolean disable)

### setLocation

    public void setLocation(java.lang.String filename,
                            int line)

### popText

    public void popText()

  Pop the accumulated text to the DOM.

### pushElement

    public void pushElement(java.lang.String name)
                     throws java.io.IOException

  Adds a new element to the current node, making the new element the current node.

  Each pushElement should be matched by a popElement.

  Parameters:
    `name` - name of the element

### pushElement

    public void pushElement(java.lang.String name,
                            NamespaceContext namespace)
                     throws java.io.IOException

  Adds a new element to the current node, making the new element the current node.

  Each pushElement should be matched by a popElement.

  Parameters:
    `name` - name of the element
    `namespace` - namespace context

### pushElementNs

    public void pushElementNs(java.lang.String name,
                              java.lang.String url)
                       throws java.io.IOException

  Adds a new element to the current node, making the new element the current node.

  Each pushElement should be matched by a popElement.

  Parameters:
    `name` - name of the element
    `url` - namespace url

### pushElement

    public void pushElement(java.lang.String prefix,
                            java.lang.String local,
                            java.lang.String url)
                     throws java.io.IOException

  Adds a namespace-aware element to the current node, making the new element the current node.

  Each pushElement should be matched by a popElement.

  Parameters:
    `prefix` - the prefix of the element name, e.g. xsl
    `local` - the local part of the element name, e.g. template
    `url` - the namespace url, e.g. http://www.xml.org/...

### pushElementCopy

    public void pushElementCopy(Node oldNode)
                         throws java.io.IOException

  Adds a top-level copy of a node to the current node, making the new element the current node. Attributes are copied, but children are not.

  Each pushElement should be matched by a popElement.

  Parameters:
    `oldNode` - the node to copy

### popElement

    public void popElement()
                    throws java.io.IOException

  Makes the parent element the current node.

### pushAttribute

    public void pushAttribute(java.lang.String name)
                       throws java.io.IOException

  Adds a new attribute with the given name to the current node, making the attribute the current node.

### pushAttribute

    public void pushAttribute(java.lang.String name,
                              NamespaceContext namespace)
                       throws java.io.IOException

  Adds a new attribute with the given name to the current node, making the attribute the current node.

### pushAttributeNs

    public void pushAttributeNs(java.lang.String name,
                                java.lang.String url)
                         throws java.io.IOException

  Adds a new attribute to the current node, making the new attribute the current node.

  Each pushAttributeNs should be matched by a popAttribute.

  Parameters:
    `name` - name of the element
    `url` - namespace url

### pushAttribute

    public void pushAttribute(java.lang.String prefix,
                              java.lang.String local,
                              java.lang.String url)
                       throws java.io.IOException

  Adds a namespace-aware attribute to the current node, making the new attribute the current node.

  Each pushAttribute should be matched by a popAttribute.

  Parameters:
    `prefix` - the prefix of the element name, e.g. xsl
    `local` - the local part of the element name, e.g. template
    `url` - the namespace url, e.g. http://www.xml.org/...

### popAttribute

    public void popAttribute()
                      throws java.io.IOException

  Sets the attribute value to the current text, and sets the current node to the parent.

### pushCopy

    public void pushCopy(Node copyNode)
                  throws java.io.IOException

  Copies the node without attributes or children.

### popCopy

    public void popCopy()
                 throws java.io.IOException

  Pops the copy.

### pushPi

    public void pushPi(java.lang.String name)
                throws java.io.IOException

  Adds a new ProcessingInstruction node with the given name to the current node, making the PI the current node.

### popPi

    public void popPi()
               throws java.io.IOException

  Sets the PI data to the current text, and sets the current node to the parent.

### pushComment

    public void pushComment()
                     throws java.io.IOException

  Adds an empty comment to the current node, making the attribute the current node.

### popComment

    public void popComment()
                    throws java.io.IOException

  Sets the comment data to the current text, and sets the current to the the parent.

### pushFragment

    public void pushFragment()
                      throws java.io.IOException

  Starts a fragment. The fragment becomes the current node.

### popFragment

    public Node popFragment()
                     throws java.io.IOException

  Returns the generated fragment. The current node does not contain the new fragment.
  Returns:
    the generated fragment.

### valueOf

    public void valueOf(java.lang.Object node)
                 throws java.io.IOException

  Adds a the contents of the node to the current node.
  Parameters:
    `node` - node to print

### copyOf

    public void copyOf(java.lang.Object value)
                throws java.io.IOException

  Adds a deep copy of the node to the current node.
  Parameters:
    `XPath` - node to be copied to the destination.

### getAttribute

    public java.lang.Object getAttribute(java.lang.String name)

  Returns the attribute with the given name.

### setAttribute

    public void setAttribute(java.lang.String name,
                             java.lang.Object value)

  Sets the attribute with the given name.

### removeAttribute

    public void removeAttribute(java.lang.String name)

  removes the attribute with the given name.

### getAttributeNames

    public java.util.Iterator getAttributeNames()

  Lists the names of all the attributes.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD