com.ximpleware
Class XMLModifier

java.lang.Object
  extended by com.ximpleware.XMLModifier

public class XMLModifier
extends java.lang.Object

XMLModifier offers an easy-to-use interface for users to take advantage of the incremental update of VTD-XML The XML modifier assumes there is a master document on which the modification is applied: users can remove an element, update a token, replace an element name, or insert new content anywhere in the document transcoding methods are built-in The process: * The modification operations are recorded first * The output() is called to generate output document


Nested Class Summary
 class XMLModifier.ByteSegment
           
 
Constructor Summary
XMLModifier()
          Argument-less constructor for XMLModifier, needs to call bind to attach the master document to an instance of XMLModifier
XMLModifier(VTDNav masterDocument)
          Constructor for XMLModifier that takes VTDNav object as the master document
 
Method Summary
 void bind(VTDNav masterDocument)
          Attach master document to this instance of XMLModifier so all the operations occuring aftewards are based on this instance of VTDNav
 int getUpdatedDocumentSize()
          Compute the size of the updated XML document without composing it
 void insertAfterElement(byte[] b)
          This method will first call getCurrentIndex() to get the cursor index value then insert the byte array b after the element
 void insertAfterElement(byte[] b, int contentOffset, int contentLen)
          This method will first call getCurrentIndex() to get the cursor index value then insert a segment of the byte array b after the element
 void insertAfterElement(byte[] b, long l1)
          This method will first call getCurrentIndex() to get the cursor index value then insert a segment of the byte array b after the element, l1 (a long)'s upper 32 bit is length, lower 32 bit is offset
 void insertAfterElement(ElementFragmentNs ef)
          Insert a namespace compensated element after cursor element
 void insertAfterElement(int src_encoding, byte[] b)
          Insert a byte array of given encoding into the master document transcoding is done underneath to ensure the correctness of output
 void insertAfterElement(int src_encoding, byte[] b, int contentOffset, int contentLen)
          This method will first call getCurrentIndex() to get the cursor index value then insert the transcoded array of bytes of a segment of the byte array b after the element
 void insertAfterElement(int src_encoding, byte[] b, long l1)
          This method will first call getCurrentIndex() to get the cursor index value then insert a segment of the byte array b (transcode into a byte array) after the element, l1 (a long)'s upper 32 bit is length, lower 32 bit is offset
 void insertAfterElement(java.lang.String s)
          This method will first call getCurrentIndex() to get the cursor index value then insert the byte value of s after the element
 void insertAfterElement(VTDNav vn, int contentOffset, int contentLen)
          This method will first call getCurrentIndex() to get the cursor index value then insert the transcoded array of bytes of a segment of the byte array b after the element the VTDNav object is the container of the XML document in byte array
 void insertAfterElement(VTDNav vn, long l1)
          This method will first call getCurrentIndex() to get the cursor index value then insert a segment of the byte array b (contained in vn, and transcode into a byte array) after the element, l1 (a long)'s upper 32 bit is length, lower 32 bit is offset
 void insertAfterHead(byte[] b)
          This method will insert byte array b after the head of cursor element,
 void insertAfterHead(byte[] b, int offset, int len)
          This method will insert a segment of the byte array b after the head of cursor element,
 void insertAfterHead(byte[] b, long l)
          This method will insert a segment of the byte array b after the head of cursor element
 void insertAfterHead(ElementFragmentNs ef)
          This method will insert an ElementFragmentNs instance after the head of cursor element,
 void insertAfterHead(int src_encoding, byte[] b)
          This method will insert the transcoded representation of byte array b after the head of cursor element,
 void insertAfterHead(int src_encoding, byte[] b, int offset, int length)
          This method will insert the transcoded representation of a segment of the byte array b after the head of cursor element,
 void insertAfterHead(int src_encoding, byte[] b, long l)
          This method will insert the transcoded representation of a segment of the byte array b after the head of cursor element,
 void insertAfterHead(java.lang.String s)
          This method will insert s' byte array representation of the string after the head of cursor element,
 void insertAfterHead(VTDNav vn, int contentOffset, int contentLen)
          This method will insert a segment of the byte array b (contained in vn, and transcode into a byte array) after the head of cursor element,
 void insertAfterHead(VTDNav vn, long l1)
          This method will insert a segment of the byte array b (contained in vn, and transcode into a byte array) after the head of cursor element,
 void insertAttribute(byte[] b)
          Insert a byte arry of an attribute after the starting tag This method will first call getCurrentIndex() to get the cursor index value if the index is of type "starting tag", then teh attribute is inserted after the starting tag
 void insertAttribute(int src_encoding, byte[] b)
          Insert the transcoded representation of a byte arry of an attribute after the starting tag This method will first call getCurrentIndex() to get the cursor index value if the index is of type "starting tag", then teh attribute is inserted after the starting tag
 void insertAttribute(java.lang.String attr)
          Insert an attribute after the starting tag This method will first call getCurrentIndex() to get the cursor index value if the index is of type "starting tag", then the attribute is inserted after the starting tag
 void insertBeforeElement(byte[] b)
          This method will first call getCurrentIndex() to get the cursor index value then insert the byte array b before the element
 void insertBeforeElement(byte[] b, int contentOffset, int contentLen)
          This method will first call getCurrentIndex() to get the cursor index value then insert a segment of the byte array b before the element
 void insertBeforeElement(byte[] b, long l1)
          This method will first call getCurrentIndex() to get the cursor index value then insert a segment of the byte array b before the element l1 (a long)'s upper 32 bit is length, lower 32 bit is offset
 void insertBeforeElement(ElementFragmentNs ef)
          Insert a namespace compensated fragment before the cursor element
 void insertBeforeElement(int src_encoding, byte[] b)
          This method will first call getCurrentIndex() to get the cursor index value then insert the transcoded representatin of the byte array b before the element
 void insertBeforeElement(int src_encoding, byte[] b, int contentOffset, int contentLen)
          This method will first call getCurrentIndex() to get the cursor index value then insert the transcoded representation of a segment of the byte array b before the element
 void insertBeforeElement(int src_encoding, byte[] b, long l1)
          This method will first call getCurrentIndex() to get the cursor index value then insert the transcoded representation of a segment of the byte array b before the element l1 (a long)'s upper 32 bit is length, lower 32 bit is offset
 void insertBeforeElement(java.lang.String s)
          This method will first call getCurrentIndex() to get the cursor index value then insert the byte value of s before the element
 void insertBeforeElement(VTDNav vn, int contentOffset, int contentLen)
          This method will first call getCurrentIndex() to get the cursor index value then insert the transcoded representation of a segment of the byte array contained in vn before the element
 void insertBeforeElement(VTDNav vn, long l)
          This method will first call getCurrentIndex() to get the cursor index value then insert the transcoded representation of a segment of the byte array contained in vn before the element l1 (a long)'s upper 32 bit is length, lower 32 bit is offset
 void insertBytesAt(int offset, byte[] content)
          insert the byte content into XML
 void insertBytesAt(int offset, byte[] content, int contentOffset, int contentLen)
          Insert a segment of the byte content into XML
 void output(java.io.OutputStream os)
          This method applies the modification to the XML document and writes the output byte content accordingly to an outputStream Notice that output is not guaranteed to be well-formed
 void output(java.lang.String fileName)
          Generate the updated output XML document and write it into a file of given name
 void remove()
          Removes content from the master XML document It first calls getCurrentIndex() if the result is a starting tag, then the entire element referred to by the starting tag is removed If the result is an attribute name or ns node, then the corresponding attribute name/value pair is removed If the token type is one of text, CDATA or commment, then the entire node, including the starting and ending delimiting text surrounding the content, is removed
 void remove(long l)
          Remove a byte segment from XML.
 void removeAttribute(int attrNameIndex)
          Remove an attribute name value pair from the master document.
 void removeContent(int offset, int len)
          Remove a segment of byte content from master XML doc.
 void removeToken(int i)
          Remove the token content.
 void reset()
          This method resets the internal state of XMLModify instance so it can be reused
 void updateElementName(java.lang.String newElementName)
          Replace the cursor element's name with a new name
 void updateToken(int index, byte[] newContentBytes)
          Update the token with the given byte array content,
 void updateToken(int index, byte[] newContentBytes, int src_encoding)
          Update the token with the transcoded representation of given byte array content,
 void updateToken(int index, byte[] newContentBytes, int contentOffset, int contentLen)
          Update token with a segment of byte array (in terms of offset and length)
 void updateToken(int index, byte[] newContentBytes, int contentOffset, int contentLen, int src_encoding)
          Update token with the transcoded representation of a segment of byte array (in terms of offset and length)
 void updateToken(int index, java.lang.String newContent)
          Update the token with the given string value, notice that string will be converted into byte array according to the encoding of the master document
 void updateToken(int index, VTDNav vn, int contentOffset, int contentLen)
          Update token with the transcoded representation of a segment of byte array contained in vn (in terms of offset and length)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLModifier

public XMLModifier()
Argument-less constructor for XMLModifier, needs to call bind to attach the master document to an instance of XMLModifier


XMLModifier

public XMLModifier(VTDNav masterDocument)
            throws ModifyException
Constructor for XMLModifier that takes VTDNav object as the master document

Parameters:
masterDocument - is the document on which the modification is applied
Throws:
ModifyException
Method Detail

bind

public void bind(VTDNav masterDocument)
          throws ModifyException
Attach master document to this instance of XMLModifier so all the operations occuring aftewards are based on this instance of VTDNav

Parameters:
masterDocument -
Throws:
ModifyException

getUpdatedDocumentSize

public int getUpdatedDocumentSize()
                           throws com.ximpleware.TranscodeException
Compute the size of the updated XML document without composing it

Returns:
updated document size
Throws:
com.ximpleware.TranscodeException

insertAfterElement

public void insertAfterElement(byte[] b)
                        throws ModifyException,
                               NavException
This method will first call getCurrentIndex() to get the cursor index value then insert the byte array b after the element

Parameters:
b -
Throws:
ModifyException
NavException

insertAfterElement

public void insertAfterElement(byte[] b,
                               int contentOffset,
                               int contentLen)
                        throws ModifyException,
                               NavException
This method will first call getCurrentIndex() to get the cursor index value then insert a segment of the byte array b after the element

Parameters:
b -
contentOffset -
contentLen -
Throws:
ModifyException
NavException

insertAfterElement

public void insertAfterElement(byte[] b,
                               long l1)
                        throws ModifyException,
                               NavException
This method will first call getCurrentIndex() to get the cursor index value then insert a segment of the byte array b after the element, l1 (a long)'s upper 32 bit is length, lower 32 bit is offset

Parameters:
b -
contentOffset -
contentLen -
Throws:
ModifyException
NavException

insertAfterElement

public void insertAfterElement(ElementFragmentNs ef)
                        throws ModifyException,
                               NavException
Insert a namespace compensated element after cursor element

Parameters:
ef - (an ElementFragmentNs object)
Throws:
ModifyException
NavException

insertAfterElement

public void insertAfterElement(int src_encoding,
                               byte[] b)
                        throws ModifyException,
                               NavException,
                               com.ximpleware.TranscodeException
Insert a byte array of given encoding into the master document transcoding is done underneath to ensure the correctness of output

Parameters:
encoding - The encoding format of the byte array
b -
Throws:
ModifyException
NavException
TranscodeException

insertAfterElement

public void insertAfterElement(int src_encoding,
                               byte[] b,
                               int contentOffset,
                               int contentLen)
                        throws ModifyException,
                               NavException,
                               com.ximpleware.TranscodeException
This method will first call getCurrentIndex() to get the cursor index value then insert the transcoded array of bytes of a segment of the byte array b after the element

Parameters:
b -
contentOffset -
contentLen -
Throws:
ModifyException
NavException
TranscodeException

insertAfterElement

public void insertAfterElement(int src_encoding,
                               byte[] b,
                               long l1)
                        throws ModifyException,
                               java.io.UnsupportedEncodingException,
                               NavException,
                               com.ximpleware.TranscodeException
This method will first call getCurrentIndex() to get the cursor index value then insert a segment of the byte array b (transcode into a byte array) after the element, l1 (a long)'s upper 32 bit is length, lower 32 bit is offset

Parameters:
b -
l1 -
Throws:
ModifyException
java.io.UnsupportedEncodingException
NavException
TranscodeException

insertAfterElement

public void insertAfterElement(java.lang.String s)
                        throws ModifyException,
                               java.io.UnsupportedEncodingException,
                               NavException
This method will first call getCurrentIndex() to get the cursor index value then insert the byte value of s after the element

Parameters:
s - the string whose byte content will be inserted into the master document
Throws:
ModifyException
java.io.UnsupportedEncodingException
NavException

insertAfterElement

public void insertAfterElement(VTDNav vn,
                               int contentOffset,
                               int contentLen)
                        throws ModifyException,
                               java.io.UnsupportedEncodingException,
                               NavException,
                               com.ximpleware.TranscodeException
This method will first call getCurrentIndex() to get the cursor index value then insert the transcoded array of bytes of a segment of the byte array b after the element the VTDNav object is the container of the XML document in byte array

Parameters:
vn -
contentOffset -
contentLen -
Throws:
ModifyException
java.io.UnsupportedEncodingException
NavException
TranscodeException

insertAfterElement

public void insertAfterElement(VTDNav vn,
                               long l1)
                        throws ModifyException,
                               java.io.UnsupportedEncodingException,
                               NavException,
                               com.ximpleware.TranscodeException
This method will first call getCurrentIndex() to get the cursor index value then insert a segment of the byte array b (contained in vn, and transcode into a byte array) after the element, l1 (a long)'s upper 32 bit is length, lower 32 bit is offset

Parameters:
vn -
l1 -
Throws:
ModifyException
java.io.UnsupportedEncodingException
NavException
TranscodeException

insertAfterHead

public void insertAfterHead(byte[] b)
                     throws ModifyException,
                            NavException
This method will insert byte array b after the head of cursor element,

Parameters:
b -
Throws:
ModifyException
NavException

insertAfterHead

public void insertAfterHead(byte[] b,
                            int offset,
                            int len)
                     throws ModifyException,
                            NavException
This method will insert a segment of the byte array b after the head of cursor element,

Parameters:
b -
offset -
len -
Throws:
ModifyException
NavException

insertAfterHead

public void insertAfterHead(byte[] b,
                            long l)
                     throws ModifyException,
                            NavException
This method will insert a segment of the byte array b after the head of cursor element

Parameters:
b -
l -
Throws:
ModifyException
NavException

insertAfterHead

public void insertAfterHead(ElementFragmentNs ef)
                     throws ModifyException,
                            NavException
This method will insert an ElementFragmentNs instance after the head of cursor element,

Parameters:
efn -
Throws:
ModifyException
NavException

insertAfterHead

public void insertAfterHead(int src_encoding,
                            byte[] b)
                     throws ModifyException,
                            NavException,
                            com.ximpleware.TranscodeException
This method will insert the transcoded representation of byte array b after the head of cursor element,

Parameters:
src_encoding -
b -
Throws:
ModifyException
NavException
TranscodeException

insertAfterHead

public void insertAfterHead(int src_encoding,
                            byte[] b,
                            int offset,
                            int length)
                     throws ModifyException,
                            NavException,
                            com.ximpleware.TranscodeException
This method will insert the transcoded representation of a segment of the byte array b after the head of cursor element,

Parameters:
src_encoding -
b -
offset -
length -
Throws:
ModifyException
NavException
TranscodeException

insertAfterHead

public void insertAfterHead(int src_encoding,
                            byte[] b,
                            long l)
                     throws ModifyException,
                            NavException,
                            com.ximpleware.TranscodeException
This method will insert the transcoded representation of a segment of the byte array b after the head of cursor element,

Parameters:
src_encoding -
b -
l -
Throws:
ModifyException
NavException
TranscodeException

insertAfterHead

public void insertAfterHead(java.lang.String s)
                     throws ModifyException,
                            java.io.UnsupportedEncodingException,
                            NavException
This method will insert s' byte array representation of the string after the head of cursor element,

Parameters:
s -
Throws:
ModifyException
NavException
TranscodeException
java.io.UnsupportedEncodingException

insertAfterHead

public void insertAfterHead(VTDNav vn,
                            int contentOffset,
                            int contentLen)
                     throws ModifyException,
                            NavException,
                            com.ximpleware.TranscodeException
This method will insert a segment of the byte array b (contained in vn, and transcode into a byte array) after the head of cursor element,

Parameters:
vn -
contentOffset -
contentLen -
Throws:
ModifyException
NavException
TranscodeException

insertAfterHead

public void insertAfterHead(VTDNav vn,
                            long l1)
                     throws ModifyException,
                            NavException,
                            com.ximpleware.TranscodeException
This method will insert a segment of the byte array b (contained in vn, and transcode into a byte array) after the head of cursor element,

Parameters:
vn -
l1 -
Throws:
ModifyException
NavException
TranscodeException

insertAttribute

public void insertAttribute(byte[] b)
                     throws ModifyException,
                            java.io.UnsupportedEncodingException
Insert a byte arry of an attribute after the starting tag This method will first call getCurrentIndex() to get the cursor index value if the index is of type "starting tag", then teh attribute is inserted after the starting tag

Parameters:
b - the byte content of e.g. " attrName='attrVal' ",notice the starting and ending white space
Throws:
ModifyException
java.io.UnsupportedEncodingException

insertAttribute

public void insertAttribute(int src_encoding,
                            byte[] b)
                     throws ModifyException,
                            java.io.UnsupportedEncodingException,
                            com.ximpleware.TranscodeException
Insert the transcoded representation of a byte arry of an attribute after the starting tag This method will first call getCurrentIndex() to get the cursor index value if the index is of type "starting tag", then teh attribute is inserted after the starting tag

Parameters:
b - the byte content of e.g. " attrName='attrVal' ",notice the starting and ending white space
Throws:
ModifyException
java.io.UnsupportedEncodingException
com.ximpleware.TranscodeException

insertAttribute

public void insertAttribute(java.lang.String attr)
                     throws ModifyException,
                            java.io.UnsupportedEncodingException
Insert an attribute after the starting tag This method will first call getCurrentIndex() to get the cursor index value if the index is of type "starting tag", then the attribute is inserted after the starting tag

Parameters:
attr - e.g. " attrName='attrVal' ",notice the starting and ending white space
Throws:
ModifyException
java.io.UnsupportedEncodingException

insertBeforeElement

public void insertBeforeElement(byte[] b)
                         throws ModifyException
This method will first call getCurrentIndex() to get the cursor index value then insert the byte array b before the element

Parameters:
b - the byte array to be inserted into the master document
Throws:
ModifyException

insertBeforeElement

public void insertBeforeElement(byte[] b,
                                int contentOffset,
                                int contentLen)
                         throws ModifyException,
                                java.io.UnsupportedEncodingException
This method will first call getCurrentIndex() to get the cursor index value then insert a segment of the byte array b before the element

Parameters:
b -
contentOffset -
contentLen -
Throws:
ModifyException
java.io.UnsupportedEncodingException

insertBeforeElement

public void insertBeforeElement(byte[] b,
                                long l1)
                         throws ModifyException,
                                java.io.UnsupportedEncodingException
This method will first call getCurrentIndex() to get the cursor index value then insert a segment of the byte array b before the element l1 (a long)'s upper 32 bit is length, lower 32 bit is offset

Parameters:
b -
l1 -
Throws:
ModifyException
java.io.UnsupportedEncodingException

insertBeforeElement

public void insertBeforeElement(ElementFragmentNs ef)
                         throws ModifyException
Insert a namespace compensated fragment before the cursor element

Parameters:
ef -
Throws:
ModifyException

insertBeforeElement

public void insertBeforeElement(int src_encoding,
                                byte[] b)
                         throws ModifyException,
                                com.ximpleware.TranscodeException
This method will first call getCurrentIndex() to get the cursor index value then insert the transcoded representatin of the byte array b before the element

Parameters:
b - the byte array to be inserted into the master document
Throws:
ModifyException
TranscodeException

insertBeforeElement

public void insertBeforeElement(int src_encoding,
                                byte[] b,
                                int contentOffset,
                                int contentLen)
                         throws ModifyException,
                                java.io.UnsupportedEncodingException,
                                com.ximpleware.TranscodeException
This method will first call getCurrentIndex() to get the cursor index value then insert the transcoded representation of a segment of the byte array b before the element

Parameters:
b -
contentOffset -
contentLen -
Throws:
ModifyException
java.io.UnsupportedEncodingException
TranscodeException

insertBeforeElement

public void insertBeforeElement(int src_encoding,
                                byte[] b,
                                long l1)
                         throws ModifyException,
                                java.io.UnsupportedEncodingException,
                                com.ximpleware.TranscodeException
This method will first call getCurrentIndex() to get the cursor index value then insert the transcoded representation of a segment of the byte array b before the element l1 (a long)'s upper 32 bit is length, lower 32 bit is offset

Parameters:
b -
l1 -
Throws:
ModifyException
java.io.UnsupportedEncodingException
TranscodeException

insertBeforeElement

public void insertBeforeElement(java.lang.String s)
                         throws ModifyException,
                                java.io.UnsupportedEncodingException
This method will first call getCurrentIndex() to get the cursor index value then insert the byte value of s before the element

Parameters:
s -
Throws:
ModifyException
java.io.UnsupportedEncodingException

insertBeforeElement

public void insertBeforeElement(VTDNav vn,
                                int contentOffset,
                                int contentLen)
                         throws ModifyException,
                                java.io.UnsupportedEncodingException,
                                com.ximpleware.TranscodeException
This method will first call getCurrentIndex() to get the cursor index value then insert the transcoded representation of a segment of the byte array contained in vn before the element

Parameters:
vn -
contentOffset -
contentLen -
Throws:
ModifyException
java.io.UnsupportedEncodingException
TranscodeException

insertBeforeElement

public void insertBeforeElement(VTDNav vn,
                                long l)
                         throws ModifyException,
                                java.io.UnsupportedEncodingException,
                                com.ximpleware.TranscodeException
This method will first call getCurrentIndex() to get the cursor index value then insert the transcoded representation of a segment of the byte array contained in vn before the element l1 (a long)'s upper 32 bit is length, lower 32 bit is offset

Parameters:
vn -
l -
Throws:
ModifyException
java.io.UnsupportedEncodingException
TranscodeException

insertBytesAt

public void insertBytesAt(int offset,
                          byte[] content)
                   throws ModifyException
insert the byte content into XML

Parameters:
offset -
content -
Throws:
ModifyException

insertBytesAt

public void insertBytesAt(int offset,
                          byte[] content,
                          int contentOffset,
                          int contentLen)
                   throws ModifyException
Insert a segment of the byte content into XML

Parameters:
offset -
content -
contentOffset -
contentLen -
Throws:
ModifyException

output

public void output(java.io.OutputStream os)
            throws java.io.IOException,
                   ModifyException,
                   com.ximpleware.TranscodeException
This method applies the modification to the XML document and writes the output byte content accordingly to an outputStream Notice that output is not guaranteed to be well-formed

Parameters:
os -
Throws:
java.io.IOException
ModifyException
com.ximpleware.TranscodeException

output

public void output(java.lang.String fileName)
            throws java.io.IOException,
                   ModifyException,
                   com.ximpleware.TranscodeException
Generate the updated output XML document and write it into a file of given name

Parameters:
fileName -
Throws:
java.io.IOException
ModifyException
com.ximpleware.TranscodeException

remove

public void remove()
            throws NavException,
                   ModifyException
Removes content from the master XML document It first calls getCurrentIndex() if the result is a starting tag, then the entire element referred to by the starting tag is removed If the result is an attribute name or ns node, then the corresponding attribute name/value pair is removed If the token type is one of text, CDATA or commment, then the entire node, including the starting and ending delimiting text surrounding the content, is removed

Throws:
NavException
ModifyException

remove

public void remove(long l)
            throws NavException,
                   ModifyException
Remove a byte segment from XML. l's upper 32 bits is length in # of bytes l's lower 32 bits is byte offset

Parameters:
l -
Throws:
NavException
ModifyException

removeAttribute

public void removeAttribute(int attrNameIndex)
                     throws ModifyException
Remove an attribute name value pair from the master document.

Parameters:
attrNameIndex -
Throws:
ModifyException

removeContent

public void removeContent(int offset,
                          int len)
                   throws ModifyException
Remove a segment of byte content from master XML doc. The segment is denoted by its offset and len.

Parameters:
offset -
len -
Throws:
ModifyException

removeToken

public void removeToken(int i)
                 throws ModifyException
Remove the token content. If the token type is text, CDATA or comment, then the entire node, including the starting and ending delimiting text, will be removed as well

Parameters:
i - the index for the content
Throws:
ModifyException

reset

public void reset()
This method resets the internal state of XMLModify instance so it can be reused


updateElementName

public void updateElementName(java.lang.String newElementName)
                       throws ModifyException,
                              NavException,
                              java.io.UnsupportedEncodingException
Replace the cursor element's name with a new name

Parameters:
newElementName -
Throws:
ModifyException
NavException
java.io.UnsupportedEncodingException

updateToken

public void updateToken(int index,
                        byte[] newContentBytes)
                 throws ModifyException,
                        java.io.UnsupportedEncodingException
Update the token with the given byte array content,

Parameters:
index -
newContentBytes -
Throws:
ModifyException
java.io.UnsupportedEncodingException

updateToken

public void updateToken(int index,
                        byte[] newContentBytes,
                        int src_encoding)
                 throws ModifyException,
                        java.io.UnsupportedEncodingException,
                        com.ximpleware.TranscodeException
Update the token with the transcoded representation of given byte array content,

Parameters:
index -
newContentBytes -
Throws:
ModifyException
java.io.UnsupportedEncodingException
TranscodeException

updateToken

public void updateToken(int index,
                        byte[] newContentBytes,
                        int contentOffset,
                        int contentLen)
                 throws ModifyException,
                        java.io.UnsupportedEncodingException
Update token with a segment of byte array (in terms of offset and length)

Parameters:
index -
newContentBytes -
contentOffset -
contentLen -
Throws:
ModifyException
java.io.UnsupportedEncodingException

updateToken

public void updateToken(int index,
                        byte[] newContentBytes,
                        int contentOffset,
                        int contentLen,
                        int src_encoding)
                 throws ModifyException,
                        java.io.UnsupportedEncodingException,
                        com.ximpleware.TranscodeException
Update token with the transcoded representation of a segment of byte array (in terms of offset and length)

Parameters:
index -
newContentBytes -
contentOffset -
contentLen -
Throws:
ModifyException
java.io.UnsupportedEncodingException
TranscodeException

updateToken

public void updateToken(int index,
                        java.lang.String newContent)
                 throws ModifyException,
                        java.io.UnsupportedEncodingException
Update the token with the given string value, notice that string will be converted into byte array according to the encoding of the master document

Parameters:
index -
newContent -
Throws:
ModifyException
java.io.UnsupportedEncodingException

updateToken

public void updateToken(int index,
                        VTDNav vn,
                        int contentOffset,
                        int contentLen)
                 throws ModifyException,
                        java.io.UnsupportedEncodingException,
                        com.ximpleware.TranscodeException
Update token with the transcoded representation of a segment of byte array contained in vn (in terms of offset and length)

Parameters:
index -
vn -
contentOffset -
contentLen -
Throws:
ModifyException
java.io.UnsupportedEncodingException
TranscodeException