none
Problem with XML and CDATA - CDATA being removed by Authoring Console

    Question

  • Hello,

    I'm facing a bad problem in the Authoring Console, Version 6.1.7221.0.

    When coding scripts the CDATA-Tag, starting and ending a script in an XML-File,  is not kept in the scripts. After saving and reloading a MP the CDATA-Tags are gone. Scripts is modified: "&" is replaced by "&" and so on. I think this is wrong !

    Authoring Console is installed on Windows 7 Enterprise SP1 .

    Hope somebody has an idea of how to overcome this.

    Thanks for your time

    sebastian


    • Edited by Sebastian Ewering Saturday, September 17, 2011 1:42 PM Added more info, corrections
    Friday, September 16, 2011 3:49 PM

Answers

  • What Dan is trying to say is that it was meant to work that way and it is displayed differently depending on how you open the script.

    1. Once you have saved the discovery or whatever you have your script in, monitor, rule or discovery, if you reopen it and go to the configuration tab and then edit button you will see the script with the special characters.

    2. If instead you click on the configure button instead and then the script tab you will see the script in the format that you are used to.

    I don't know the technical details behind this behavior, but Dan does. Maybe we can get him to enlighten us. I am always curious about stuff like this.

     

     

     

     

    Tuesday, September 20, 2011 4:53 PM

All replies

  • Actually this is perfectly fine :) 

    Is there any problem?


    Microsoft Corporation
    Monday, September 19, 2011 3:55 PM
  • What Dan is trying to say is that it was meant to work that way and it is displayed differently depending on how you open the script.

    1. Once you have saved the discovery or whatever you have your script in, monitor, rule or discovery, if you reopen it and go to the configuration tab and then edit button you will see the script with the special characters.

    2. If instead you click on the configure button instead and then the script tab you will see the script in the format that you are used to.

    I don't know the technical details behind this behavior, but Dan does. Maybe we can get him to enlighten us. I am always curious about stuff like this.

     

     

     

     

    Tuesday, September 20, 2011 4:53 PM
  • What I am really pointing is that the CDATA is generally not required.  It is helpful if you are displaying the XML in an older browser, but since IE9, even CDATA doesn't preserve white space in the rendered content in the browser.

    In XML, & is not a valid character, so the valid way to display it is "&Amp;".  Call it the XML tax.

    Of course, if you insist on not having the CDATA go away, use notepad instead of the authoring console to twiddle your XML.


    Microsoft Corporation
    Tuesday, September 20, 2011 6:26 PM
  • What I am really pointing is that the CDATA is generally not required.  It is helpful if you are displaying the XML in an older browser, but since IE9, even CDATA doesn't preserve white space in the rendered content in the browser.

    In XML, & is not a valid character, so the valid way to display it is "&Amp;".  Call it the XML tax.

    Of course, if you insist on not having the CDATA go away, use notepad instead of the authoring console to twiddle your XML.


    Microsoft Corporation
    notepad, the preferred editor!
    Tuesday, September 20, 2011 7:07 PM
  • Thanks to all,

    as it was quite important I even opened a case with MS Support.

    But we could not reproduce the strange behaviour.

    What I see is:

    a)when you use the Configure button ( please step through the wizards yourself ) then only the script is opened, without CDATA.

    b) opening same script in same wizard via Edit then much more data is loaded into the external editor. Also CDATA is displayed.

    The MP was deployed correctly, I could not reproduce my former observation.

    Now it is important that I have a safe way for editing. Whatever the wrong way was, I really  I don't need it...

    Special thanks to Dethgiver

    sebastian

    Wednesday, September 21, 2011 9:51 AM
  •   I am seeing a similar and intermittent issue - vbs script appears intact in edit pane, but if you edit the xml you see the entities (such as <) replacing operators in if statements etc; if you manually replace the text with the correct version, and add the CDATA tags, then it appears superficially ok (i.e. viewing in xml view shows correct text and CDATA tags) but when the compiled MP makes it into scom and you examine the resulting code on the RMS you see that again the entities are replacing the operators and you get vbs compilation errors in the opman event log.

      I suspect that this is some "bad data" in the target scom system's db, but am reluctant to start taking that apart without some clue as to why things are going badly...

    Monday, April 23, 2012 11:36 AM
  • Hi syscare,

    I have found a way how to cope with this situation:

    DONOT use Authoring Console to edit scripts.

    I have started to edit directly inside XML, putting VB-Scripts or PowerShell Scripts in a CDATA-"Envelope".

    Works great ! Never got problems any more.

    Hope this is a help for you.

    regards

    sebastian

    Monday, April 23, 2012 12:44 PM
  • Hi Sebastian,

      I did that, and it worked fine right up to the point I used mpseal to convert to mp format - that does the same as the authoring console and gives me running scripts on the RMS with &lt; instead of < etc...

    Monday, April 23, 2012 4:04 PM
  • Hi syscare,

    I feel perfect with sealing.

    My Development tools:

    - notepad++ for editing in XML,

    - Authoring Console: Verify XML-Files, easily modify names and texts, so I donot need to search in the XML.  And I use it for creating sealed MPs ! When you specify the path for the keyfile be sure the path does not contain spaces.

    So I donot use mpseal, at least not directly in a commandline. I always use Authoring Console to seal the MP. ( By the way: I need sealed MPs for being allowed to create overrides later. We donot author for customers but only for our own purpose.)

    regards

    sebastian

    Tuesday, April 24, 2012 6:51 AM
  • Yes, same here. In my case, I am "rolling my own" solution for a number of reasons - mainly that the vendor management packs for some of our most vital systems are a joke, and not a particularly funny one, but given I *am* a programmer my instinct is to replace them myself (rather than pay a third party for their better-but-still-not-ideal offerings). I also want something better than grouping stuff manually given we are running multiple agents on multiple sites, and an ideal solution *should* know what site a given device is on without having to add a decorative field to store that info (with all the ongoing documentation maint issues that implies)

    However, both the authoring console AND the standalone tool have a tendency to output entity-contaminated MP files from correctly formatted XML files. I am busy with my management here trying to get the issue raised as a paid call with MS (hopefully before 2010 is released and we get a handwaving "you aren't on the current version" response *sigh*)

    Tuesday, April 24, 2012 9:11 AM
  • Ok, just tried again with the 32 bit version of the console (well, was worth a try :) but nada.
    Tuesday, April 24, 2012 9:57 AM
  • Bad luck....

    Have you tried to start an MP from scratch , editing with notepad++ ?

    Tuesday, April 24, 2012 1:07 PM
  • No, but if I remove the monitored object, its discovery, relationships, monitors and so forth, then re-add it will often "take" the script as CDATA. It just means a lot of messing about to work around the issue.
    Wednesday, April 25, 2012 8:58 AM