|
Changes since the last release |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ebay.sdk.util.XmlUtil
public abstract class XmlUtil
Xml related helper functions.
Title:
Description:
Copyright: Copyright (c) 2004
Company: eBay Inc.
Constructor Summary | |
---|---|
XmlUtil()
|
Method Summary | |
---|---|
static void |
appendAttributeNode(Element parent,
String name,
int value)
|
static void |
appendAttributeNode(Element parent,
String name,
String value)
|
static void |
appendAttributeNode(String namespace,
Element parent,
String name,
int value)
|
static void |
appendAttributeNode(String namespace,
Element parent,
String name,
String value)
|
static Element |
appendChildNode(Document doc,
Node parent,
String name)
|
static Element |
appendChildNode(Document doc,
Node parent,
String name,
int value)
|
static Element |
appendChildNode(Document doc,
Node parent,
String name,
String value)
|
static Element |
appendChildNode(Document doc,
String namespace,
Node parent,
String name)
|
static Element |
appendChildNode(Document doc,
String namespace,
Node parent,
String name,
String value)
|
static Element |
appendChildNodeCDATA(Document doc,
Node parent,
String name,
int value)
|
static Element |
appendChildNodeCDATA(Document doc,
Node parent,
String name,
String value)
|
static Document |
createDom()
|
static Document |
createDom(File file)
Method to create a DOM document tree from a file |
static Document |
createDom(InputStream is)
Method to create a DOM document tree from a InputStream |
static Document |
createDom(String xml)
Method to create a DOM document tree from a valid XML string |
static Document |
createDomByPathname(String pathname)
Method to create a DOM document tree from a fuke |
static Node |
findAttribute(Node node,
String name)
Finds attribute of node by name. |
static Node |
findNode(Node node,
String nodeName)
Find node by name recursively. |
static boolean |
getAttributeBoolean(Node node,
String name)
Gets the boolean value of a named attribute of a node. |
static double |
getAttributeDouble(Node node,
String name,
double errValue)
Gets the double value of a named attribute of a node. |
static int |
getAttributeInteger(Node node,
String name,
int errValue)
Gets the integer value of a named attribute of a node. |
static String |
getAttributeString(Node node,
String name)
Gets the value of a named attribute of a node. |
static boolean |
getChildBoolean(Node node,
String xpath)
|
static boolean |
getChildBooleanByName(Node node,
String nodeName)
"1" means true. |
static Node |
getChildByName(Node node,
String nodeName)
Find node by name. |
static Date |
getChildDate(Node node,
String xpath)
|
static double |
getChildDouble(Node node,
String xpath)
|
static double |
getChildDoubleByName(Node node,
String nodeName,
double errValue)
|
static int |
getChildInteger(Node node,
String xpath)
|
static int |
getChildIntegerByName(Node node,
String nodeName,
int errValue)
|
static String |
getChildString(Node node,
String xpath)
|
static String |
getChildStringByName(Node node,
String nodeName,
String errValue)
|
static String |
getChildStringNS(Element element,
String namespace,
String childName)
|
static String |
getXmlStringFromDom(Document doc)
Method to get formatted Xml string from Xml document |
static String |
getXmlStringFromSource(Source payload)
Method to get formatted Xml string from Xml source |
static void |
saveDomToFile(Document doc,
String filePath)
Save content of DOM to a file. |
static void |
setChildValue(Document doc,
Node parent,
String childName,
int value)
|
static void |
setChildValue(Document doc,
Node parent,
String childName,
String value)
|
static String |
xslTransform(Document xmlDoc,
Document xslDoc)
Performs XSL transformation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlUtil()
Method Detail |
---|
public static String getXmlStringFromSource(Source payload)
payload
- Source
public static String getXmlStringFromDom(Document doc)
doc
-
public static Document createDom(String xml) throws SAXException, IOException, ParserConfigurationException
xml
- String
SAXException
IOException
ParserConfigurationException
public static Document createDom() throws SAXException, IOException, ParserConfigurationException
SAXException
IOException
ParserConfigurationException
public static Document createDom(File file) throws SAXException, IOException, ParserConfigurationException
file
- Source file for the DOM
SAXException
IOException
ParserConfigurationException
public static Document createDom(InputStream is) throws SAXException, IOException, ParserConfigurationException
is
- InputStream
SAXException
IOException
ParserConfigurationException
public static Document createDomByPathname(String pathname) throws SAXException, IOException, ParserConfigurationException
pathname
- Source file for the DOM
SAXException
IOException
ParserConfigurationException
public static Element appendChildNode(Document doc, Node parent, String name)
doc
- Documentparent
- Nodename
- String
public static Element appendChildNode(Document doc, String namespace, Node parent, String name)
doc
- Documentnamespace
- Stringparent
- Nodename
- String
public static Element appendChildNode(Document doc, Node parent, String name, int value)
doc
- Documentparent
- Nodename
- Stringvalue
- int
public static Element appendChildNode(Document doc, Node parent, String name, String value)
doc
- Documentparent
- Nodename
- Stringvalue
- String
public static Element appendChildNode(Document doc, String namespace, Node parent, String name, String value)
doc
- Documentnamespace
- Stringparent
- Nodename
- Stringvalue
- String
public static void appendAttributeNode(Element parent, String name, String value)
parent
- Elementname
- Stringvalue
- Stringpublic static void appendAttributeNode(String namespace, Element parent, String name, String value)
namespace
- Stringparent
- Elementname
- Stringvalue
- Stringpublic static void appendAttributeNode(Element parent, String name, int value)
parent
- Elementname
- Stringvalue
- intpublic static void appendAttributeNode(String namespace, Element parent, String name, int value)
namespace
- Stringparent
- Elementname
- Stringvalue
- intpublic static Element appendChildNodeCDATA(Document doc, Node parent, String name, int value)
doc
- Documentparent
- Nodename
- Stringvalue
- int
public static Element appendChildNodeCDATA(Document doc, Node parent, String name, String value)
doc
- Documentparent
- Nodename
- Stringvalue
- String
public static String getChildString(Node node, String xpath) throws TransformerException
node
- Nodexpath
- String
TransformerException
public static String getChildStringNS(Element element, String namespace, String childName)
element
- Elementnamespace
- StringchildName
- String
public static int getChildInteger(Node node, String xpath) throws TransformerException
node
- Nodexpath
- String
TransformerException
public static boolean getChildBoolean(Node node, String xpath) throws TransformerException
node
- Nodexpath
- String
TransformerException
public static double getChildDouble(Node node, String xpath) throws TransformerException
node
- Nodexpath
- String
TransformerException
public static Date getChildDate(Node node, String xpath) throws TransformerException, ParseException
node
- Nodexpath
- String
TransformerException
ParseException
public static Node findNode(Node node, String nodeName)
node
- NodenodeName
- String
public static Node getChildByName(Node node, String nodeName)
node
- NodenodeName
- String
public static String getChildStringByName(Node node, String nodeName, String errValue)
node
- NodenodeName
- StringerrValue
- String
public static int getChildIntegerByName(Node node, String nodeName, int errValue)
node
- NodenodeName
- StringerrValue
- int
public static boolean getChildBooleanByName(Node node, String nodeName)
node
- NodenodeName
- String
public static double getChildDoubleByName(Node node, String nodeName, double errValue)
node
- NodenodeName
- StringerrValue
- double
public static String xslTransform(Document xmlDoc, Document xslDoc) throws TransformerConfigurationException, TransformerException
xmlDoc
- DocumentxslDoc
- Document
TransformerConfigurationException
TransformerException
public static Node findAttribute(Node node, String name)
node
- Node The context node.name
- String
public static String getAttributeString(Node node, String name)
node
- Node The context node.name
- String
public static int getAttributeInteger(Node node, String name, int errValue)
node
- Node The context node.name
- StringerrValue
- int
public static double getAttributeDouble(Node node, String name, double errValue)
node
- Node The context node.name
- StringerrValue
- double
public static boolean getAttributeBoolean(Node node, String name)
node
- Nodename
- String
public static void setChildValue(Document doc, Node parent, String childName, String value)
doc
- Documentparent
- NodechildName
- Stringvalue
- Stringpublic static void setChildValue(Document doc, Node parent, String childName, int value)
doc
- Documentparent
- NodechildName
- Stringvalue
- intpublic static void saveDomToFile(Document doc, String filePath) throws Exception
doc
- DocumentfilePath
- String
Exception
|
Changes since the last release |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The information contained in this document is proprietary and confidential.
Use of this information and the eBay API requires a Non-Disclosure Agreement (NDA) between the user and eBay Inc.
For information regarding a qualifying NDA, contact Developer Relations:
developer-relations@ebay.com
© 2004-2009 eBay Inc. All rights reserved.