XML.appendChild();

how do I append a child to an empty xml.
var myXML:XML = new XML();
var myOtherXML:XML = <Greeting> Hi <Greeting>
var myOtherXML2:XML = <Name> James <Name>
myXML.appendChild(myOtherXML) //TypeError: Error #1088: The markup in the document following the root element must be well-formed.
myXML.appendChild(myOtherXML2)//TypeError: Error #1088: The markup in the document following the root element must be well-formed.
basically I would like to combine two xml files into one xml file that does not have a root. Can this be done?

the fact they are missing "/"'s is not the problem
...well that's the reason why you got those errors
What you want to create is not an XML but an XMLList.
var myXMLList:XMLList = new XMLList();
myXMLList[0] = myOtherXML;
myXMLList[1] = myOtherXML2;
trace(myXMLList);
Trace
<Greeting>Hi</Greeting>
<Name>James</Name>
Kenneth Kawamoto
http://www.materiaprima.co.uk/

Similar Messages

  • Xml appendChild goes nuts?

    Hello all,
    when copying nodes from one XML object to another using appendChild(), sometimes the copied nodes aren't put at the end of the XML object.
    I've added a file to test this:
    Put a number into the field, ranging from 1 to 3, and click addNode.
    It copies a specific node (FileID = 1,..3) from one XML object to another, and trace shows the result.
    If I add 1,2,3,1,2 consecutively, then the last node '2' isn't added at the end of the new XML object, but somewhere in between.
    I did find a work around by converting the node to a string and then appending that. But the fact that appending an XML node doesn't always put it at the end of the XML object puzzles me. It looks like a bug, doesn't it?
    This is on Flash CS3.
    Kind regards,
    Henk

    Seems the only way around this "bug" is to use an XMLList, like so:
    var mxml:XML =
    <onlinemedia>
      <ProductFile>
        <FileID>1</FileID>
        <FileName><![CDATA[JC11.jpg]]></FileName>
        <Tooltip><![CDATA[]]></Tooltip>
        <Description><![CDATA[]]></Description>
        <IsMultimedia>false</IsMultimedia>
        <Url><![CDATA[http://www.nn.eu/Handlers/GetFile.ashx?id=239&t=.jpg]]></Url>
        <Episode><![CDATA[act 1]]></Episode>
      </ProductFile>
      <ProductFile>
        <FileID>2</FileID>
        <FileName><![CDATA[JC11.jpg]]></FileName>
        <Tooltip><![CDATA[]]></Tooltip>
        <Description><![CDATA[]]></Description>
        <IsMultimedia>false</IsMultimedia>
        <Url><![CDATA[http://www.nn.eu/Handlers/GetFile.ashx?id=239&t=.jpg]]></Url>
        <Episode><![CDATA[act 1]]></Episode>
      </ProductFile>
      <ProductFile>
        <FileID>3</FileID>
        <FileName><![CDATA[JC11.jpg]]></FileName>
        <Tooltip><![CDATA[]]></Tooltip>
        <Description><![CDATA[]]></Description>
        <IsMultimedia>false</IsMultimedia>
        <Url><![CDATA[http://www.nn.eu/Handlers/GetFile.ashx?id=239&t=.jpg]]></Url>
        <Episode><![CDATA[act 1]]></Episode>
      </ProductFile>
    </onlinemedia>;
    var exml:XML =
    <onlinemedia>
    </onlinemedia>;
    addn.addEventListener(MouseEvent.CLICK, addNode);
    deln.addEventListener(MouseEvent.CLICK, delNode);
    function addNode(evt:Event):void {
    var lst:XMLList = exml.children();
    lst += mxml.ProductFile.(FileID == varb.text);
    exml.setChildren(lst)
    trace(exml.toXMLString());

  • TextFlow XML export issue with missing whitespaces

    If I export a TextFlow into XML (with either TextFlowUtil or TextConverter) it will lose white spaces where they occur between elements, so that a subsequence import will yield different content from the original. A simple example being:
    "Where is my white space". Will export and re-import to give: "Whereismywhitespace".
    This happens in the XML build process because when a text node is programatically appended (with appendChild()) white spaces are stripped from the start and end. For example, if you do xml.appendChild("     hello    ") you actually get an XML element containing just "hello".
    Now I understand there is a directive (XML.ignoreWhiteSpace) to ignore or keep white space when parsing nodes already set in the XML, but I cannot see how to do this when you are building the XML from some data structure (like a TextFlow), or indeed when creating an XML object from a String that contains XML notation.
    I am unaware how you can include surrounding whitespace in an XML node (short of CDATA). And the fact that the TextFlow XML import/export loses information seems to make it, well, pretty pointless.
    So, how do I retain these white spaces in a TextFlow in an exported XML?

    The solution for this problem consists of two parts.
    First part is exporting the xml from the textflow, you want no formatted XML (with breaks, tabs, ...), but one long string with the spaces left like there were entered between the tags, this can be done with:
    _textXML = TextConverter.export(EditorID.textFlow,TextConverter.TEXT_LAYOUT_FORMAT,ConversionType.STRING_TYPE) as String;
    Use the TextConverter in stead of the TextFlowUtil.
    Second part is back importing to textFlow:
    There the solution mentioned above was correct.
    XML.ignoreWhitespace = false;
    var flowXML:XML = new XML(_textXML);
    contentTLF = TextFlowUtil.importFromXML(flowXML,WhiteSpaceCollapse.PRESERVE);

  • HTTPService POST with XML does not declare charset encoding

    Hi all.
    I'm trying to do a HTTP POST of some XML using HTTPService
    and I've got it working apart form the fact that the HTTP message
    sent does no declare what charcater set it is using for encoding.
    As a test I send a 'ñ' character and it seems from the
    resultant bytes that the charset being used is UTF-8.
    My ActionScript is...
    var xml:XML=new XML(<root/>);
    xml.@testCharacter="ñ";
    xml.appendChild(<login/>);
    xml.login.@username="bob";
    xml.login.@password="secret";
    var httpService:HTTPService=new HTTPService();
    httpService.url='
    http://app.localhost/null';
    httpService.method="POST";
    httpService.contentType=HTTPService.CONTENT_TYPE_XML;
    httpService.request=xml;
    httpService.send();
    And what seems to get sent over the wire is (shown in
    8bit-ASCII)...
    POST /null HTTP/1.1
    Host: app.localhost
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
    rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7
    Accept:
    text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png ,*/*;q=0.5
    Accept-Language: en,en-us;q=0.7,en-gb;q=0.3
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 300
    Connection: keep-alive
    Content-type: application/xml
    Content-length: 77
    <root testCharacter="A±">
    <login username="bob" password="secret"/>
    </root>
    Anyone know (1) how I can control what character set gets
    used for encoding and (2) how I can get either XML or HTTPService
    to declare what the encoding is?
    Thanks in advance, Neil.

    Jarod,
    XML parser product managers who might be able to help you on a parser-specific issue like this "hang out" here on OTN in the XML forum. Have you tried posting there to catch their attention? Thanks.

  • Creating XML dynamically

    Hi,
    I need to create XML which follows this exact structure:
    <root>
        <node>
            <row>
                <item>item01</item>
                <item>item02</item>
            </row>
            <row>
                <item>item03</item>
                <item>item04</item>
            </row>
            <row>
                <item>item05</item>
                <item>item06</item>
            </row>
        </node>
    </root>
    but I need to do it dynamically, so I am doing this:
    var xml:XML = <root></root>;
    xml.appendChild(<node></node>);
    xml.child("node").appendChild(<row></row>);
    xml.child("node").child("row").appendChild(<item>item01</item>);
    xml.child("node").child("row").appendChild(<item>item02</item>);
    xml.child("node").appendChild(<row></row>);
    xml.child("node").child("row").appendChild(<item>item03</item>);
    xml.child("node").child("row").appendChild(<item>item04</item>);
    and I get this error:
    TypeError: Error #1086: The appendChild method only works on lists containing one item.
        at XMLList/http://adobe.com/AS3/2006/builtin::appendChild()
        at xml_fla::MainTimeline/frame1()
    Any suggestions as to what I can do?  I can change the format as the script on the server is expecting this format.
    I have tried using SimpleXMLEncoder and tried creating the XML from an Object but neither of these helped.
    Any suggestions warmly welcome...
    Thanks

    try:
    var xml:XML = <root></root>;
    xml.appendChild(<node></node>);
    xml.child("node").appendChild(<row></row>);
    xml.child("node").child("row").appendChild(<item>item01</item>);
    xml.child("node").child("row").appendChild(<item>item02</item>);
    xml.child("node").appendChild(<row></row>);
    xml.child("node").row[1].appendChild(<item>item03</item>);
    xml.child("node").row[1].appendChild(<item>item04</item>);

  • Replicate XML structure

    If I have an empty dataprovider which an XML how can I create another XML with a structure that would match the dataprovider?
    Thanks

    var xml:XML =<root>
    <subroot><someElement>data</someElement>
    </subroot>
    </root>;
    and
    dataGrid.dataProvider = xml;
    Thats it!! not quotes around the xml here.
    if you want to create xml programmatically then,
    xml.appendChild(<someChild></someChild>); //from the xml above
    xml.subroot.appendChild(<someChild>test</someChild>);

  • Is it possible to dynamically create xml nodes?

    Hi,
    Is it possible to dynamically create child nodes of an xml
    file with flash??
    Im what i want to do is save a users name etc in an xml file
    without having to manually add nodes in.
    So when a user clicks a button to save their details a new
    node is created.
    Thnx

    Yes.
    Look
    at XML.appendChild as a starting point.

  • Writing to XML

    I am trying to update value of a xml node. below is the code -
          <fx:Declarations>
                <s:HTTPService id="srv" url="comVars/userInfo.xml"/>
          </fx:Declarations>
          <fx:Script>
                <![CDATA[
                      import flash.net.*;
                      public var userInfo:XML;
                      public var url:URLRequest;
                      public var loader:URLLoader;
                      public function skipPwd():void{
                            url = new URLRequest("comVars/userInfo.xml");
                            loader = new URLLoader(url);
                            loader.addEventListener(Event.COMPLETE, skipPwd2);                     
                      public function skipPwd2(event:Event):void{
                            if(loader.data){
                                  userInfo = XML(loader.data);
                            userInfo.replace("pwdSet", <pwdSet>Skip</pwdSet>);
                ]]>
          </fx:Script>
                    <s:Button x="642" y="283" label="Skip Pwd" click="skipPwd()"/>
    Can someone tell me whats going wrong here? Or i need to approch another way?
    Thanks,
    Vaibhav

    If your question is about writing XML in AS3, here is an example:
    var xml:XML = <root></root>;
    var node:XML;
    var node1:XML;
    for (var i:int = 0; i < 4; i++) {
         node = <level1/>;
         xml.appendChild(node);
         for (var j:int = 0; j < 3; j++) {
              node1 = <level2/>;
              node1.appendChild("text " + i + " " + j);
              node.appendChild(node1);
    trace(xml);
    Documentation is here:
    http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/XML.html
    kglad has covered server side aspect.

  • Create XML file dynamically from textInput fields

    Hi,
    I'm very new to Flex and trying to create an application that creates XML files on the users' local computer, based on a users input into textInput fields.
    At the moment I'm having trouble finding how to dyamically create an external XML file at all, ideally when the user pushes a button a browseForSave dialog box will open allowing the user to select somewhere on their hard drive to create the XML file.
    Can anyone give me a hint what direction I should be heading in?
    Thanks

    If this post answered your question or helped, please mark it as such.
    You could use a SharedObject for small files, but in general Flex does not have access to the local hard drive.
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
      initialize="init()">
      <mx:Script>
        <![CDATA[
          public var mySO:SharedObject;
          public function init():void{
            mySO = SharedObject.getLocal("mydata");
            if(mySO.data.myData!=null){
              var xml:XML = mySO.data.myData;
              fname.text = xml.fname;
              lname.text = xml.lname;
              email.text = xml.email;
          private function storeData():void{
            var xml:XML =
              <data/>;
            if(fname.text != ""){
              xml.appendChild(<fname>{fname.text}</fname>);
            if(lname.text != ""){
              xml.appendChild(<lname>{lname.text}</lname>);
            if(email.text != ""){
              xml.appendChild(<email>{email.text}</email>);
            mySO.data.myData = xml;
            mySO.flush();
          private function resetData():void{
            mySO.clear();
            fname.text = "";
            lname.text = ""
            email.text = "";
        ]]>
      </mx:Script>
      <mx:Form>
        <mx:FormItem label="First Name:">
          <mx:TextInput id="fname"/>
        </mx:FormItem>
        <mx:FormItem label="Last Name:">
          <mx:TextInput id="lname"/>
        </mx:FormItem>
        <mx:FormItem label="Email:">
          <mx:TextInput id="email"/>
        </mx:FormItem>
      </mx:Form>
      <mx:Button label="Store Data" click="storeData()"/>
      <mx:Button label="Reload Stored Data" click="init()"/>
      <mx:Button label="Delete Stored Data" click="resetData()"/>
    </mx:Application>

  • XML Publisher with more then one VO

    Hi;
    I have a requirement to show a custom PDF report on click of a button in a custom OAF page. so with the help of [http://apps2fusion.com/at/ps/260-integrating-xml-publisher-and-oa-framework|http://apps2fusion.com/at/ps/260-integrating-xml-publisher-and-oa-framework] I am able to prepare a xml publisher PDF report with single VO(select query) where as in my requirement I required to write more then one VO(select querys). Can anybody give some ideas how to proceed?
    GsrC.

    hi;
    i have multiple viewObject and i did what you said and i generated the XML file
    but the problem i have that
    the generated xml file was
    <Msat>
    <MasterVO>
    <MasterVORow>
         <BidValidUntil></BidValidUntil>
         <AdvancePayment>5051</AdvancePayment>
         <Duration>99</Duration>
         <PaymentType>%</PaymentType>
         <GroupName></GroupName>
    </MasterVORow>
    </MasterVO>
    *<SupplierNameVO>*
    *<SupplierNameVORow>*
    *<Segment1></Segment1>*
    *<VendorName></VendorName>*
    *<VendorId></VendorId>*
    *</SupplierNameVORow>*
    *</SupplierNameVO>*
    </Msat>
    but i want to be in this form
    <MSat>
    <MasterVO>
    <MasterVORow>
         <BidValidUntil></BidValidUntil>
         <AdvancePayment>5051</AdvancePayment>
         <Duration>99</Duration>
         <PaymentType>%</PaymentType>
         <GroupName></GroupName>
    *<SupplierNameVO>*
    *<SupplierNameVORow>*
    *<Segment1></Segment1>*
    *<VendorName></VendorName>*
    *<VendorId></VendorId>*
    *</SupplierNameVORow>*
    *</SupplierNameVO>* </MasterVORow>
    </MasterVO>
    </MSat>
    how can i do that if each <suuplier>and <master>are from differnt views and when i tried to use XML>appendChild()
    it gave me this error message
    oracle.xml.parser.v2.XMLDOMException: cannot add a node belonging to a different document
    do any one know the solution for this problem
    thx

  • Converting mxml data to xml

    Hi All,
    Anydody have the code to convert mxml data to .xml file. I
    have found this code in net.
    class XMLUtil {
    static function as2xml(obj: Object, nodeName: String) {
    var xml:XML=new XML();
    xml.appendChild(xml.createElement(nodeName));
    for (var i in obj) {
    handleItem(xml, obj
    , i);
    return xml;
    private static function handleItem(xml, item, nodeName:
    String) {
    var type=typeof item;
    if (type=="string" || type=="number" || item instanceof
    Date) {
    var el=xml.createElement(nodeName);
    el.appendChild(xml.createTextNode(item));
    xml.firstChild.appendChild(el);
    } else if (item instanceof Array) {
    for(var i=0; i<item.length; i++)
    handleItem(xml, item, nodeName);
    } else if (item instanceof Object)
    xml.firstChild.appendChild(as2xml(item, nodeName));
    But its not working. I created relevant as files. Anybody
    have the code to convert to mxml data to xml like above.
    Thanks & Regards,
    Siva Kumar

    MXML is already an well formed XML document.(look at mxml
    files first line it says : <?xml version="1.0"
    encoding="utf-8"?> ) you cant convert from xml to xml(or to be
    more correct why do you need to convert from XMl to XML?), if you
    want to transform it use XSLT, but thats totally different story,
    what you are showing here is Action script to XMl convertor,
    and from this code its not obvious to see what is the problem since
    you are showing general util methods nothing concrete,

  • Managing multiple external jpgs for use in virtual tour

    I've posted for help in a few forums now including this one. I have a big delima that I cannot overcome using google alone.
    I'm creating an interactive tour (pretty much a controllable slideshow) and I have multiple pictures now that, if in the correct order, will walk you around my school. You can turn left or right at doors (the picture that you're stopped at will wait for input from either the up, left, or right button and when clicked will take you to the corrisponding picture) and will eventually lead you out another entrance of the school and take you back to the main map.
    My problem lies in the pictures... I have hundreds of pictures each one needing to be referanced. The only thing I have figured out is that I need to use arrays to organize these pictures and make them easier to access. I have considered using XML to organize the lists of pictures but I cannot spend hours typing out all the names of the pictures.
    I need an easy way to access my pictures from outside my flash AS3 project.
    A reply with links to helpful things or even some code I could use would be extremely helpful.
    *pictures organized in folders as such...
    Walkthrough Pictures/
              a1
              a2
              a3
              a4
              a5
              a6
              b1
              b2
              b3
              b4
              b5
              b6/DSCN0042.JPG
                   DSCN0044.JPG
                   DSCN0045.JPG
                   DSCN0049.JPG
    and so on...

    // this creates the outer elements
    var xml:XML =
                <slideshow>
                 </slideshow>;
    while (xml.image.length() <  688){
    // <image/> is the inner element
        var item:XML = <image />;
        var photoIndex =  xml.image.length() + 1001;
    //  @ refers to attribute
        item.@src = "images/"+  photoIndex.toString().substr(1) + ".jpg";     // substr(1) is starts the string at position 1 rather than 0 this
    removes the leading 1 so that 1001.jpg becomes 001.jpg etc
        xml.appendChild(item);
    trace(xml);
    the output looks like this:
    <slideshow>
      <image src="images/001.jpg"/>
      <image src="images/002.jpg"/>
      <image src="images/003.jpg"/>
      <image src="images/687.jpg"/>
      <image src="images/688.jpg"/>
    </slideshow>
    to access this
             var holder:Sprite = new Sprite();
                xmlLoader = new URLLoader();  
                xmlLoader.addEventListener(Event.COMPLETE, onXMLLoadComplete);
                xmlLoader.load(new URLRequest(strXMLPath));
    function onXMLLoadComplete(e:Event):void {
                     loader.contentLoaderInfo.addEventListener(Event.COMPLETE, displaySlide);
                     loader.load(new URLRequest(xmlSlideshow..@src[intCurrentSlide]));
                        // intCurrentSlide is is 00n.jpg   an xmllist is an Array
    function displaySlide(e:Event):void {
              loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, displaySlide);
                holder.addChild(loader.content);   // this adds the image to a Sprite
                addChildAt(holder, 0);                // this addh holder to stage at level 0
                if(holder.numChildren > 1){holder.removeChildAt(0);}  // remove bottom image in holder so no more than 1 image
              is displayed at a time

  • Third question - Using parameters in powershell recovery - Alert description

    Hi guys,
    With help i created powershell recovery in a management pack. Once again thanks very much, this is new to me. Now i know these parameters (variables):
    http://blogs.technet.com/b/kevinholman/archive/2009/09/23/alert-notification-subscription-variables-and-linking-that-to-the-console-database-and-sdk.aspx
    But how can i implement this in this XML? I think i must declare them in the XML, because when i put the variable there, it doesn't work. I would like to get the alert description in the message variable (see xml below)
    </Recovery>
    <Recovery ID="MomUIGenaratedRecovery28e1547022254ccbb82784c60d51b1d2" Accessibility="Public" Enabled="true" Target="Type603f92b7b83945598af55495615db953" Monitor="UIGeneratedMonitor0cd347f57f3949deb958cebb02d25555" ResetMonitor="false" ExecuteOnState="Error" Remotable="true" Timeout="300">
    <Category>Custom</Category>
    <WriteAction ID="MomUIGenaratedModule75df98fbfc5b48e39fd605cccd97d29b" TypeID="Windows!Microsoft.Windows.PowerShellWriteAction">
    <ScriptName>sendSMS.ps1</ScriptName>
    <ScriptBody>
    # function SendSMS
    # PowerShell function to send SMS messages via the CM SMS Gateway.
    function SendSMS{
    param([string]$url, [int]$customer, [string]$login, [string]$password, [string]$recipient, [string]$sender,[string]$reference)
    $xml = New-Object XML
    $messages = $xml.CreateElement("MESSAGES")
    $customerxml = $xml.CreateElement("CUSTOMER")
    $customerxml.SetAttribute("ID", $customer)
    $messages.AppendChild($customerxml)|Out-Null
    $user = $xml.CreateElement("USER")
    $user.SetAttribute("LOGIN", $login)
    $user.SetAttribute("PASSWORD", $password)
    $messages.AppendChild($user) |Out-Null
    if (!($reference.Equals(''))) {
    $refxml = $xml.CreateElement("REFERENCE")
    $refxml.Innertext = $reference
    $messages.AppendChild($refxml) |Out-Null
    $tariff = $xml.CreateElement("TARIFF")
    $tariff.InnerText = 0
    $messages.AppendChild($tariff) |Out-Null
    $msg = $xml.CreateElement("MSG")
    $from = $xml.CreateElement("FROM")
    $from.InnerText = $sender
    $msg.AppendChild($from) |Out-Null
    $to = $xml.CreateElement("TO")
    $to.InnerText = $recipient
    $msg.AppendChild($to) |Out-Null
    $body = $xml.CreateElement("BODY")
    $body.SetAttribute("TYPE", "TEXT")
    $body.InnerText = $message
    $msg.AppendChild($body) |Out-Null
    $messages.AppendChild($msg) |Out-Null
    $xml.AppendChild($messages) |Out-Null
    Write-Output $xml.OuterXml
    $webClient = New-Object net.WebClient
    return ($webClient.UploadString($url, $xml.OuterXml))
    # test
    SendSMS -url 'https://website.sms.nl/webservice.ashx' -recipient 0031612345678 -customer 1 -login 1 -password 'password' -sender 'Standby' -message 'Here i want the alert description' -reference '1234'
    </ScriptBody>
    <TimeoutSeconds>60</TimeoutSeconds>
    </WriteAction>
    Kind regards,
    André

    Parameters are defined between ScriptBody and TimeoutSeconds like this:
    <Parameters>
    <Parameter>
    <Name>param1</Name>
    <Value>$Config/param1$</Value>
    </Parameter>
    <Parameter>
    <Name>param2</Name>
    <Value>$Config/param2$</Value>
    </Parameter>
    </Parameters
    This information is available on MSDN.
    Jonathan Almquist | SCOMskills, LLC (http://scomskills.com)

  • Second queston using powershell in SCOM as recovery

    Hi guys,
    In a previous question i needed some ideas about using powershell in a recovery.
    Now i've implemented this in the XML, but it gives me this error as i import my managementpack back in SCOM 2012 R2 UR 2
    Error, it gives the error on Microsoft.Windows.PowerShellWriteAction too:
    If any management packs in the Import list are dependent on this management pack, the installation of the dependent management packs will fail.
    Cannot resolve identifier Windows!Microsoft.Windows.PowerShellWriteAction in the context of management pack ANWB.Informatica.Powercenter0. Unknown alias: Windows.
    <Recovery ID="MomUIGenaratedRecovery7187d8e283b44c9c9a115f06af5d3dcc" Accessibility="Public" Enabled="true" Target="Type603f92b7b83945598af55495615db953" Monitor="UIGeneratedMonitor0cd347f57f3949deb958cebb02d25555" ResetMonitor="false" ExecuteOnState="Error" Remotable="true" Timeout="300">
    <Category>Custom</Category>
    <WriteAction ID="MomUIGenaratedModule8ea82cdaccd8404b810409334cc50e47" TypeID="Windows!Microsoft.Windows.PowerShellWriteAction">
    <ScriptName>SendSMS-XMLPOST.ps1</ScriptName>
    <Arguments />
    <ScriptBody>function SendSMS{
    param([string]$url, [int]$customer, [string]$login, [string]$password, [string]$recipient, [string]$sender, [string]$message, [string]$reference)
    $xml = New-Object XML
    $messages = $xml.CreateElement("MESSAGES")

    Vladimir,
    Thanks for your response.
    Ofcourse i can. Here you got my XML. These are my changes to the XML:
    In the typedefenitions -> moduletypes:
    <ModuleTypes>
    <!-- ABO ADDED code 18-07-2014 -->
    <WriteActionModuleType ID="Microsoft.Windows.PowerShellWriteAction" Accessibility="Public" Batching="false">
    <Configuration>
    <IncludeSchemaTypes>
    <SchemaType>Microsoft.Windows.PowerShellSchema</SchemaType>
    </IncludeSchemaTypes>
    <xsd:element name="ScriptName" type="NonNullString" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="ScriptBody" type="NonNullString" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="SnapIns" type="SnapInsType" minOccurs="0" maxOccurs="1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="Parameters" type="NamedParametersType" minOccurs="0" maxOccurs="1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="TimeoutSeconds" type="xsd:integer" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="StrictErrorHandling" type="xsd:boolean" minOccurs="0" maxOccurs="1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="SerializationDepth" type="xsd:integer" minOccurs="0" maxOccurs="1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    </Configuration>
    <OverrideableParameters>
    <OverrideableParameter ID="TimeoutSeconds" Selector="$Config/TimeoutSeconds$" ParameterType="int" />
    </OverrideableParameters>
    <ModuleImplementation Isolation="Any">
    <Composite>
    <MemberModules>
    <WriteAction ID="PowerShellWriteAction" TypeID="Microsoft.Windows.PowerShellWriteActionBase">
    <ScriptName>$Config/ScriptName$</ScriptName>
    <ScriptBody>$Config/ScriptBody$</ScriptBody>
    <SnapIns>$Config/SnapIns$</SnapIns>
    <Parameters>$Config/Parameters$</Parameters>
    <TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
    <OutputType>SerializedObjectData_OpsMgrSerialization</OutputType>
    <StrictErrorHandling>$Config/StrictErrorHandling$</StrictErrorHandling>
    <SerializationDepth>$Config/SerializationDepth$</SerializationDepth>
    </WriteAction>
    </MemberModules>
    <Composition>
    <Node ID="PowerShellWriteAction" />
    </Composition>
    </Composite>
    </ModuleImplementation>
    <OutputType>Microsoft.Windows.SerializedObjectData</OutputType>
    <InputType>System!System.BaseData</InputType>
    </WriteActionModuleType>
    <WriteActionModuleType ID="Microsoft.Windows.PowerShellWriteActionBase" Accessibility="Internal" Batching="false">
    <Configuration>
    <IncludeSchemaTypes>
    <SchemaType>Microsoft.Windows.PowerShellSchema</SchemaType>
    </IncludeSchemaTypes>
    <xsd:element name="ScriptName" type="NonNullString" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="ScriptBody" type="NonNullString" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="SnapIns" type="SnapInsType" minOccurs="0" maxOccurs="1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="Parameters" type="NamedParametersType" minOccurs="0" maxOccurs="1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="TimeoutSeconds" type="xsd:integer" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="OutputType" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="SerializedObjectData_OpsMgrSerialization" />
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    <xsd:element name="StrictErrorHandling" type="xsd:boolean" minOccurs="0" maxOccurs="1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="SerializationDepth" type="xsd:integer" minOccurs="0" maxOccurs="1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    </Configuration>
    <ModuleImplementation Isolation="Any">
    <Managed>
    <Assembly>Microsoft.EnterpriseManagement.Modules.PowerShell, Culture="", PublicKeyToken="31bf3856ad364e35", Version="6.0.4900.0"</Assembly>
    <Type>Microsoft.EnterpriseManagement.Modules.PowerShell.PowerShellProbeActionModule</Type>
    </Managed>
    </ModuleImplementation>
    <OutputType>Microsoft.Windows.SerializedObjectData</OutputType>
    <InputType>System!System.BaseData</InputType>
    </WriteActionModuleType>
    </ModuleTypes>
    <!-- ABO ADDED code 18-07-2014 -->
    And in the monitor recovery:
    <!-- ABO ADDED code 18-07-2014 -->
    <Recovery ID="MomUIGenaratedRecovery7187d8e283b44c9c9a115f06af5d3dcc" Accessibility="Public" Enabled="true" Target="MPAuthoring.PowerShellScript.ServiceTarget" Monitor="MPAuthoring.PowerShellScript.ServiceMonitor" ResetMonitor="false" ExecuteOnState="Warning" Remotable="true" Timeout="300">
    <Category>Custom</Category>
    <WriteAction ID="ServiceRestartScriptWriteAction" TypeID="Windows!Microsoft.Windows.PowerShellWriteAction">
    <ScriptName>SendSMS-XMLPOST.ps1</ScriptName>
    <Arguments />
    <ScriptBody>function SendSMS{
    param([string]$url, [int]$customer, [string]$login, [string]$password, [string]$recipient, [string]$sender, [string]$message, [string]$reference)
    $xml = New-Object XML
    $messages = $xml.CreateElement("MESSAGES")
    $customerxml = $xml.CreateElement("CUSTOMER")
    $customerxml.SetAttribute("ID", $customer)
    $messages.AppendChild($customerxml)|Out-Null
    $user = $xml.CreateElement("USER")
    $user.SetAttribute("LOGIN", $login)
    $user.SetAttribute("PASSWORD", $password)
    $messages.AppendChild($user) |Out-Null
    if (!($reference.Equals(''))) {
    $refxml = $xml.CreateElement("REFERENCE")
    $refxml.Innertext = $reference
    $messages.AppendChild($refxml) |Out-Null
    $tariff = $xml.CreateElement("TARIFF")
    $tariff.InnerText = 0
    $messages.AppendChild($tariff) |Out-Null
    $msg = $xml.CreateElement("MSG")
    $from = $xml.CreateElement("FROM")
    $from.InnerText = $sender
    $msg.AppendChild($from) |Out-Null
    $to = $xml.CreateElement("TO")
    $to.InnerText = $recipient
    $msg.AppendChild($to) |Out-Null
    $body = $xml.CreateElement("BODY")
    $body.SetAttribute("TYPE", "TEXT")
    $body.InnerText = $message
    $msg.AppendChild($body) |Out-Null
    $messages.AppendChild($msg) |Out-Null
    $xml.AppendChild($messages) |Out-Null
    Write-Output $xml.OuterXml
    $webClient = New-Object net.WebClient
    return ($webClient.UploadString($url, $xml.OuterXml))
    # test
    SendSMS -url 'https://sms.nl/' -recipient 0031123456789 -customer 1 -login 1 -password 'password' -sender 'Standby' -message 'Test' -reference '1234'</ScriptBody>
    <!-- ABO ADDED code 18-07-2014 -->

  • Sort column in advanceddatagrid

    Hi, i have an interesting question - how to sort column id
    datagrid, like i clicked on a header. I use AdvancedDataGrid and
    HierarchialData

    Yes, it works for HierarchicalCollectionView, but works for
    only first level of the tree. Like I sort an XMLListCollection,
    comparefunction handles only full elements of the first level. I
    need also to sort children nodes of the thee (customer wants).
    I have done it for XMLListCollection which is the source of
    HierarchialData but it's too many letters =)) and i need sort it
    and refresh HierarchialData after every change. Advanced datagrid
    makes it automatically by pressing on a header.
    Here is the code:
    quote:
    public static function
    sortXMLListCollection(xml:XMLListCollection,dataField:String):XMLListCollection
    var sorting:Sort=new Sort();
    sorting.fields=[new SortField(dataField)];
    xml.sort=sorting;
    xml.refresh();
    for each(var item:XML in xml)
    XMLUtils.sortXMLNode(item,sorting);
    return xml;
    public static function
    sortXMLNode(node:XML,sorting:Sort):XML
    var tempXML:XMLListCollection=new XMLListCollection(node.*);
    tempXML.sort=sorting;
    tempXML.refresh();
    XMLUtils.clearNode(node);
    XMLUtils.appendXMLListInXML(node,tempXML.copy());
    for each(var item:XML in node.*)
    XMLUtils.sortXMLNode(item,sorting);
    return node;
    public static function
    appendXMLListInXML(xml:XML,xmlList:XMLList):XML
    for each(var appendXML:XML in xmlList)
    xml.appendChild(appendXML)
    return xml;
    public static function clearNode(xml:XML):XML
    for(var i:int=new
    XMLListCollection(xml.*).length-1;i>=0;i--)
    delete xml.*
    return xml;

Maybe you are looking for

  • Question on Netbackup configuration

    DB version : 11.2 OS platform : AIX 6.1 Netbackup version : 7 I need to configure RMAN backup to tape for my Production DB using netbackup as the MML. The instruction given to me was Shutdown all DBs running from this Oracle Home        # Missed this

  • Trying to make changes in Terminal but can't get past the password request

    I am trying to run Piano Wizard from a managed accout but I get this: Data.pwf missing I found these FIX instructions on their web site but I can't get it to work.... METHOD1: If you know the password of the owner account of the machine. Please follo

  • Office Printer for MAC

    Can anyone suggest a printer for a small office that will also scan and fax that is compatiable with MAC?

  • The effect of cube and rollup function

    1. For under 500,000 in Oracle 9i, rollup is faster than cube. But above 1,000,000, cube is faster than rollup. Right? 2. Why do rollup(a) and cube(a) all have a parameter? 3. Under only one parameter, the compute process of cube and rollup is not th

  • Quick and DIRTY Canon S90 lens correction

    From ACR 6.1 choose the Canon G10 profile, make it the default for the S90, set Distortion slider to 85, CA slider to 105, Vignette left at default 100.  I picked the values examining a 6mm (widest) brick wall image, then checked tracking for other f