Designer and XML Validation
Novell Cool Solutions: Tip
By Geoffrey Carman
Digg This -
Posted: 25 Jul 2007
An interesting bug/feature to watch out for in Designer revolves around XML Validation. One of the really nice features in Designer (and iManager as well) is that when you to see a rule you need to use, you can look at the XML view, copy it, and paste it where you need it.
Normally the XML validator is excellent and catches any mistakes, such as missing a closing tag. You know, you copied from <rule> to the end, but forgot to copy the closing </rule> element. (This happens to me a lot!)
What you should be aware of is that the validator is mostly looking for valid XML. You can still paste in 'stupid' XML that will break things. Here is an example:
Stupid XML Trick
I was copying the contents of an entire rule set, but I did not want the <policy> tag with the XML DTD definition at the top. I foolishly copied from the <description> tag to the very end. I pasted that into the middle of an existing Policy object.
So I did not copy the
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE policy PUBLIC "policy-builder-dtd" "/data/programs/designer.201/designer/eclipse/plugins/com.novell.designer.idm.policybuilder_22.214.171.124705161501/DTD/dirxmlscript.dtd"><policy> <description>Transform NMAS attribute to password elements</description> <rule disabled="true"> <description>Convert adds of the nspmDistributionPassword attribute to password elements</description> <conditions> <and> <if-operation op="equal">add</if-operation> <if-op-attr name="nspmDistributionPassword" op="available"/> </and> </conditions> <actions> <!-- Change all add-attr elements for the nspmDistributionPassword attribute to password elements--> <do-set-dest-password> <arg-string> <token-xpath expression="add-attr[@attr-name='nspmDistributionPassword']//value"/> </arg-string> </do-set-dest-password> <!-- Remove all add-attr elements for the nspmDistributionPassword attribute --> <do-strip-op-attr name="nspmDistributionPassword"/> </actions> </rule> </policy>
I got this error message in trace, a new one to me! Too many descriptions - what?
DirXML Log Event ------------------- Driver: \TIDM\US\NYC\idm\treelink\Notes Channel: Subscriber Status: Error Message: Code(-9126) Error in vnd.nds.stream://TIDM/US/NYC/idm/treelink/Notes/Subscriber/Password%28Sub%29-Transform+Distribution+Password#XmlData:61 : Too many 'description' elements specified.
Well, my rule had a bit that looked like this, due to my poor copy:&l<policy yada...> <rule> yada yada yada </rule> <description>Transform NMAS attribute to password elements</description> <rule disabled="true"> <description>Convert adds of the nspmDistributionPassword attribute to password elements</description>
You cannot have a <description> element between </rule> and the next <rule>, according to the DirXML engine.
But because it had the </description> closing tag, it was valid XML, and the validator was OK with it.
Thus, you need to watch out for "stupid" mistakes where the problem exists between keyboard and chair (PEBKAC)!
Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com