com.sap.mw.jco.jra
Interface XMLConverter


public interface XMLConverter

Casting on this interface provides posibility to convert JCA Records to/from XML


Method Summary
 void fromXML(java.lang.String xmlDocument)
          Parses the specified XML document and fills in those fields of the map whose names coincide with the tags in the XML document.
 void readXML(java.io.Reader reader)
          Reads an XML document (in UTF-8 codepage) and fills the fields of the map from the XML data
 java.lang.String toXML()
          Returns the whole record in XML format. Note: Field names in SAP system may contain characters which are illegal in XML element names.
Legal elements names however can be assembled by using the following transformation rules:
The characters 'A'-'Z', 'a'-'z', or '_' are not mapped.
 void writeXML(java.io.Writer writer, boolean with_header)
          Dump the map as a XML document to the specified stream.
 

Method Detail

toXML

public java.lang.String toXML()
                       throws java.sql.SQLException
Returns the whole record in XML format.

Note: Field names in SAP system may contain characters which are illegal in XML element names.
Legal elements names however can be assembled by using the following transformation rules:

  • The characters 'A'-'Z', 'a'-'z', or '_' are not mapped.
  • The characters '0'-'9' or '.' are not mapped unless they appear as the first character in a element name.
  • '/' is mapped to '-_'
  • Any other ASCII character is mapped to the sequence '_--XX', where XX is the 2-digit hexadecimal code of the ASCII character
    (e.g. '&' is represented as '_--26').
    The value part of an element may contain the following mappings:
  • The characters '<', '&', and '>' are being mapped to '&#60;', '&#38;', and '&#62;', respectively.
    Returns:
    the record as an XML document
    Throws:
    java.sql.SQLException - thrown if the record could not be converted to an XML document

  • fromXML

    public void fromXML(java.lang.String xmlDocument)
                 throws java.sql.SQLException
    Parses the specified XML document and fills in those fields of the map whose names coincide with the tags in the XML document.
    Parameters:
    xmlDocument - the the xml document
    Throws:
    java.sql.SQLException - thrown if an error occured

    writeXML

    public void writeXML(java.io.Writer writer,
                         boolean with_header)
                  throws java.sql.SQLException,
                         java.io.IOException
    Dump the map as a XML document to the specified stream. All data will be encoding in UTF-8.
    Parameters:
    writer - the Wrtiter writing the function to xml
    with_header - if true prepends the XML header,
    i.e. <?xml version="1.0" encoding="UTF-8"?>
    Throws:
    java.io.IOException - thrown if an IO error occurred
    java.sql.SQLException - thrown if another error occurred

    readXML

    public void readXML(java.io.Reader reader)
                 throws java.sql.SQLException,
                        java.io.IOException
    Reads an XML document (in UTF-8 codepage) and fills the fields of the map from the XML data
    Parameters:
    reader - the Reader which reads a document in the xml form
    Throws:
    java.io.IOException - thrown if an IO error occurred
    java.sql.SQLException - thrown if another error occurred