Hello All,
I want to marshall an XML file produced by MS's XmlDiffer. In the
following "diffgram" XmlDiff specifies that the XML fragment
"<book>Harry
Potter and the Half Blood Prince</book>" should be added to the fifth
child node of the second child node of the root, in order to construct
The second XML doc from the first.
<xd:xmldiff ... attributes omitted
<xd:node match="2" >
<xd:node match="5" />
<xd:add>
<book>Harry Potter And The Half Blood Prince</book>
</xd:add>
</xd:node>
</xd:xmldiff>
I want to write a mapping file that is sufficiently flexible to marshal
<xd:add> tags containing arbitrary XML content. So far I am able to
gather the #text of <book/>, child nodes and the value of attributes,
using the matches attribute of <bind-xml/> into a general class, XDXML
(which, I suppose, will come to resemble org.w3c.dom.Node).
<class name="XDXML" auto-complete="false">
<field name="text"
type="string"
required="false"
direct="false"
transient="false"
get-method="getText"
set-method="setText" >
<bind-xml node="text"/>
</field>
<field name="attributes"
type="string"
required="false"
direct="false"
transient="false"
get-method="getAttributes"
set-method="setAttributes"
collection="collection">
<bind-xml matches="*" node="attribute"/>
</field>
<field name="children"
type="string"
required="false"
direct="false"
transient="false"
get-method="getChildren"
set-method="setChildren"
collection="collection">
<bind-xml matches="*" node="element"/>
</field>
</class>
setAttributes looks like this:
/**
* Mutator to set value of Attributes
* @param Collection Children
**/
public void setAttributes(Collection oCol) {
m_oChildren.addAll( oCol);
}
However, the names of the child nodes and the names of the
attributes are missing. Is there some way to pass the names
of arbitrary elements and attributes into my XML class XDXML?
Regards,
Max
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-user