You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Rob Elliott <re...@MarchNetworks.com> on 2010/02/22 18:34:01 UTC
XMLConfiguration Empty Tag syntax
I'm parsing some XML and moving it over from one XMLConfiguration object
to another as follows:
private void mergeTopNode(XMLConfiguration masterCfg, XMLConfiguration
mergedCfg,
String nodeName)
{
SubnodeConfiguration subNode =
masterCfg.configurationAt(nodeName);
List nodeList = new ArrayList();
nodeList.add(subNode.getRootNode());
mergedCfg.clearTree(nodeName);
mergedCfg.addNodes("", nodeList);
}
I have an issue where the node in the first configuration is:
<Foo>
</Foo>
Using the code above the node appears in the second configuration as
<Foo/>
I checked http://www.w3.org/TR/REC-xml/#dt-empty and the syntax is legal
however the consumer of the second configuration does not seem to follow
the standard. Is there a setting in the library that I could use to
enforce the orginal syntax?
Thanks.
RE: [configuration] XMLConfiguration Empty Tag syntax
Posted by Rob Elliott <re...@MarchNetworks.com>.
Yes, the xml is valid and can browse using IE. Thank you for your
response.
-----Original Message-----
From: Oliver Heger [mailto:oliver.heger@oliver-heger.de]
Sent: Monday, February 22, 2010 3:42 PM
To: Commons Users List
Subject: Re: [configuration] XMLConfiguration Empty Tag syntax
Am 22.02.2010 18:34, schrieb Rob Elliott:
> I'm parsing some XML and moving it over from one XMLConfiguration
object
> to another as follows:
>
>
>
> private void mergeTopNode(XMLConfiguration masterCfg, XMLConfiguration
> mergedCfg,
>
> String nodeName)
>
> {
>
> SubnodeConfiguration subNode =
> masterCfg.configurationAt(nodeName);
>
> List nodeList = new ArrayList();
>
> nodeList.add(subNode.getRootNode());
>
> mergedCfg.clearTree(nodeName);
>
> mergedCfg.addNodes("", nodeList);
>
> }
>
>
>
> I have an issue where the node in the first configuration is:
>
>
>
> <Foo>
>
> </Foo>
>
>
>
> Using the code above the node appears in the second configuration as
>
>
>
> <Foo/>
>
>
>
> I checked http://www.w3.org/TR/REC-xml/#dt-empty and the syntax is
legal
> however the consumer of the second configuration does not seem to
follow
> the standard. Is there a setting in the library that I could use to
> enforce the orginal syntax?
>
Unfortunately there is no such setting. The formatting capabilities of
XMLConfiguration are pretty limited.
But just to make sure: The outcome is valid XML, right? You can open it
with other XML editors or web browsers?
Oliver
>
>
> Thanks.
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: [configuration] XMLConfiguration Empty Tag syntax
Posted by Oliver Heger <ol...@oliver-heger.de>.
Am 22.02.2010 18:34, schrieb Rob Elliott:
> I'm parsing some XML and moving it over from one XMLConfiguration object
> to another as follows:
>
>
>
> private void mergeTopNode(XMLConfiguration masterCfg, XMLConfiguration
> mergedCfg,
>
> String nodeName)
>
> {
>
> SubnodeConfiguration subNode =
> masterCfg.configurationAt(nodeName);
>
> List nodeList = new ArrayList();
>
> nodeList.add(subNode.getRootNode());
>
> mergedCfg.clearTree(nodeName);
>
> mergedCfg.addNodes("", nodeList);
>
> }
>
>
>
> I have an issue where the node in the first configuration is:
>
>
>
> <Foo>
>
> </Foo>
>
>
>
> Using the code above the node appears in the second configuration as
>
>
>
> <Foo/>
>
>
>
> I checked http://www.w3.org/TR/REC-xml/#dt-empty and the syntax is legal
> however the consumer of the second configuration does not seem to follow
> the standard. Is there a setting in the library that I could use to
> enforce the orginal syntax?
>
Unfortunately there is no such setting. The formatting capabilities of
XMLConfiguration are pretty limited.
But just to make sure: The outcome is valid XML, right? You can open it
with other XML editors or web browsers?
Oliver
>
>
> Thanks.
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org