Part of xml

Hi. I have a string containing xml code
i need to put only a part of this code into another string
Is it possibile with any object?
i mean:
<?xml version="1.0" encoding="ISO-8859-1"?>
<tag1>test</tag1>
<tag2>
<tag2a>xxx</tag2a>
<tag2b>yyy</tag2b>
</tag2>
<tag3>test</tag3>
<tag4>test</tag4>
i need to put the string "<tag2><tag2a>xxx</tag2a><tag2b>yyy</tag2b></tag2>" into a variable
can you help me please?

thank you dvohra09
It works, but there is one thing:
this is the output string
<?xml version = '1.0'?>
<#document-fragment>
<servizio id="DTD_WS-AS-01" versione="1.0">
<lavoratore lId="336">
<codiceFiscale>yyy</codiceFiscale>
<statoOccupazionale>DISOCCUPATO</statoOccupazionale>
<codStato>1</codStato>
<dataStato>14/12/2003</dataStato>
<centroImpiego>pAVIA</centroImpiego>
<codCPI>33222</codCPI>
</lavoratore>
<lavoratore lId="32">
<codiceFiscale>zzzz</codiceFiscale>
<statoOccupazionale>OCCUPATO</statoOccupazionale>
<codStato>0</codStato>
<dataStato>14/10/2003</dataStato>
<centroImpiego>Milano</centroImpiego>
<codCPI>31346</codCPI> </lavoratore>
</servizio>
</#document-fragment>
is it possible not to have the string "<?xml version = '1.0'?>" and "<#document-fragment>" and "</#document-fragment> " included in the string?

Similar Messages

  • SharePoint 2010 Error while executing web part: System.Xml.Xsl.XslLoadException: XSLT compile error.

    Hello,
    I currently having a series of errors (18 issues) that are occurring under the below Correlation ID ad1a22f5-1ddb-4fa5-8487-143cb6fd0f9d
    I have listed (3) that are in the Web Parts category, this error/issue is causing several timed job to no longer work properly I have been trying to find the root cause for about a week now. If anyone has encountered a issue
    such as this one I'm open for suggestions.     
    (1)
    Error while executing web part: System.Xml.Xsl.XslLoadException: XSLT compile error. An error occurred at (1,475). ---> System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
    ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.     at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest
    asyncRequest, Exception exception)     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer,
    AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer,
    AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer,
    AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult
    lazyResult)     at System.Threading.ExecutionContext.runTryCode(Object userData)     at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)    
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)     at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)     at System.Net.TlsStream.Write(Byte[]
    buffer, Int32 offset, Int32 size)     at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)     at System.Net.ConnectStream.WriteHeaders(Boolean async)     --- End of inner exception
    stack trace ---     at System.Net.HttpWebRequest.GetResponse()     at System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials)     at System.Xml.XmlUrlResolver.GetEntity(Uri
    absoluteUri, String role, Type ofObjectToReturn)     at Microsoft.SharePoint.WebPartPages.WSSXmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)     at System.Xml.Xsl.Xslt.XsltLoader.CreateReader(Uri
    uri, XmlResolver xmlResolver)     at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(Uri uri, Boolean include)     at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include)    
    --- End of inner exception stack trace ---     at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include)     at System.Xml.Xsl.Xslt.XsltLoader.Load(Compiler compiler, Object stylesheet, XmlResolver
    xmlResolver)     at System.Xml.Xsl.Xslt.Compiler.Compile(Object stylesheet, XmlResolver xmlResolver, QilExpression& qil)     at System.Xml.Xsl.XslCompiledTransform.CompileXsltToQil(Object stylesheet, XsltSettings
    settings, XmlResolver stylesheetResolver)     at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)     at System.Xml.Xsl.XslCompiledTransform.Load(XmlReader
    stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)     at Microsoft.SharePoint.WebPartPages.DataFormWebPart.LoadXslCompiledTransform(WSSXmlUrlResolver someXmlResolver)     at Microsoft.SharePoint.WebPartPages.DataFormWebPart.GetXslCompiledTransform()    
    at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform(Boolean bDeferExecuteTransform)
    (2)
    InnerException 1: System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according
    to the validation procedure.     at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception exception)     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[]
    buffer, Int32 count, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[]
    buffer, Int32 count, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[]
    buffer, Int32 count, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ForceAuthentication(Boolean
    receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)     at System.Threading.ExecutionContext.runTryCode(Object userData)    
    at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback,
    Object state)     at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)     at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)     at System.Net.PooledStream.Write(Byte[]
    buffer, Int32 offset, Int32 size)     at System.Net.ConnectStream.WriteHeaders(Boolean async)     --- End of inner exception stack trace ---     at System.Net.HttpWebRequest.GetResponse()    
    at System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials)     at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)     at Microsoft.SharePoint.WebPartPages.WSSXmlUrlResolver.GetEntity(Uri
    absoluteUri, String role, Type ofObjectToReturn)     at System.Xml.Xsl.Xslt.XsltLoader.CreateReader(Uri uri, XmlResolver xmlResolver)     at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(Uri uri, Boolean include)    
    at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include)
    (3)
    InnerException 2: System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.     at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest
    asyncRequest, Exception exception)     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer,
    AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer,
    AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer,
    AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)     at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult
    lazyResult)     at System.Threading.ExecutionContext.runTryCode(Object userData)     at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)    
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)     at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)     at System.Net.TlsStream.Write(Byte[]
    buffer, Int32 offset, Int32 size)     at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)     at System.Net.ConnectStream.WriteHeaders(Boolean async)

    Hello,
    It seems that issue is related to certificate. Could you please upload certificate to central admin and make it trust.
    Just try this and see the result:
    http://social.technet.microsoft.com/Forums/en-US/cbc58585-1673-4c91-b8c1-1b95c339bbb7/could-not-establish-trust-relationship-for-the-ssltls-secure-channel?forum=fastsharepoint
    http://social.msdn.microsoft.com/Forums/en-US/7a7e56ba-6e95-4a84-9384-791818cce89d/the-underlying-connection-was-closed-could-not-establish-trust-relationship-for-the-ssltls-secure?forum=sharepointdevelopmentprevious
    http://www.infotext.com/help/sharepoint-could-not-estabilish-trust-relationship-for-the-ssltls-secure-channel-when-crawling-ssl-enabled-websites/
    If still face the issue then tell us more about your webparts and also confirm if you are facing same problem to other page and site.
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • How to get part of XML

    I am creating xml by using xmlBean. The xml look like:
    <rsi xmlns="http://abc.com/responseRSI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://abc.com/responseRSI">
    <rsitransaction type="equitydecision">
         <guid>2E11D8AE-708C-48B7-9118-475B-211F-0631</guid>
         <transactionstatus>
              <statuscode>ok</statuscode>
              <statusmessage></statusmessage>
         </transactionstatus>
         <decisionstatus>
              <statuscode>A</statuscode>
              <statusmessage></statusmessage>
         </decisionstatus>
         <logininformation>
              <accessid>ldfjsflk</accessid>
              <password>45464564</password>
         </logininformation>
    </rsitransaction>
    </rsi>
    I need to extract the part of xml as a string like:
    <rsitransaction type="equitydecision">
         <guid>2E11D8AE-708C-48B7-9118-475B1211F631</guid>
         <transactionstatus>
              <statuscode>ok</statuscode>
              <statusmessage></statusmessage>
         </transactionstatus>
         <decisionstatus>
              <statuscode>A</statuscode>
              <statusmessage></statusmessage>
         </decisionstatus>
         <logininformation>
              <accessid>ldfjsflk</accessid>
              <password>45464564</password>
         </logininformation>
    </rsitransaction>
    How can I do this one.

    Hi All,
    There will be classes created for rsi and rsitransaction Elements .
    You can use rsi.getRsitransaction().xmlText() to fetch the portion of the XML you are looking for..
    Regards
    Sateesh

  • Extract part of xml into CLOB or XMLType

    I need to extract part of XML into CLOB or some another type. But I don't need only extract data, by whole part od xml with elements. How could I do it in PL/SQL?
    For example from this xml:
    <bookstore>
    <book category="COOKING">
    <title lang="en">Everyday Italian</title>
    <author>Giada De Laurentiis</author>
    <year>2005</year>
    <price>30.00</price>
    </book>
    <book category="CHILDREN">
    <title lang="en">Harry Potter</title>
    <author>J K. Rowling</author>
    <year>2005</year>
    <price>29.99</price>
    </book>
    </bookstore>
    I need to get:
    "<book category="COOKING">
    <title lang="en">Everyday Italian</title>
    <author>Giada De Laurentiis</author>
    <year>2005</year>
    <price>30.00</price>
    </book>"
    THX

    That's why I need to process every book alone - to know which authors belongs to single book.For that specific requirement, a single query would do.
    Assuming variable "v_xml_clob" holds the XML document :
    <bookstore>
      <name>nameOfBookstore</name>
      <address>1st Avenue 24, SF</address>
          <book category="COOKING">
            <title lang="en">Everyday Italian</title>
            <author>
              <name>Giada De Laurentiis</name>
              <birth>1956</birth>
            </author>
            <author>
              <name>xxx</name>
              <birth>1955</birth>
            </author>
            <year>2005</year>
            <price>30.00</price>
          </book>
          <book category="CHILDREN">
            <title lang="en">Harry Potter</title>
            <author>
              <name>Rowning</name>
              <birth>1977</birth>
            </author>
            <author>
              <name>xxx</name>
              <birth>1955</birth>
            </author>
            <year>2005</year>
            <price>29.99</price>
          </book>
    </bookstore>You can do :
    SELECT *
    FROM XMLTable(
    'for $i in distinct-values($d//book/author/name)
      where count($d//book/author[name=$i]) = 1
      return $i'
    passing xmltype(v_xml_clob) as "d"
    columns author_name varchar2(80) path '.'
    AUTHOR_NAME
    Rowning
    Giada De Laurentiis

  • How to retrieve a part of XML document

    Dear Everyone
    I am using
    Oracle: Berkeley DB XML 2.4.16: (October 21, 2008)
    Berkeley DB 4.6.21: (September 27, 2007)
    with python api on mac OSX.
    I want to copy a part of XML document within the document.
    For example, assume that we have the following XML in dbxml.
    <A>
    <B id="1">
    <C>hello</C>
    <D>hi</D>
    </B>
    </A>
    I want to copy <B> with different "id" like,
    <A>
    <B id="1">
    <C>hello</C>
    <D>hi</D>
    </B>
    <B id="2">
    <C>hello</C>
    <D>hi</D>
    </B>
    </A>
    How can I do this?
    One more question. I want to retrieve a part of XML as string.
    For example,
    I want to have a string ' <B id="1"><C>hello</C><D>hi</D></B>'
    How can I do this?
    Thank you very much for your kind help in advance.
    Best regards,
    -Yoshi

    Hi,
    I couldn't add a document like you described:
    dbxml
    dbxml> createC test.dbxml
    dbxml> putD "mydoc" "<C>hello</C><D>hi</D>" "s"
    stdin:5: putDocument failed, Error: Error: XML Indexer: Fatal Parse error in document at line 1, char 13. Parser message: Expected comment or processing instruction (Document: mydoc)
    but, if I fix it and make it well formed it worked, so for
    the experiment I did that:
    dbxml> putD "mydoc" "<mydoc><C>hello</C><D>hi</D></mydoc>" "s"
    Document added, name = mydoc
    I could have added as two separate documents, document 1: <C>hello</C>,
    document 2: <D>hi</D>, but, I don't know what you are trying to do, so
    I'll stick with this example to the first.
    Then I ran a query to show what you did:
    dbxml> query 'collection("test.dbxml")/mydoc/*'
    2 objects returned for eager expression 'collection("test.dbxml")/mydoc/*'
    dbxml> print
    <C>hello</C>
    <D>hi</D>
    I can do the same thing using a query that returns something:
    dbxml> query 'for $i in collection("test.dbxml")/mydoc/* return $i'
    2 objects returned for eager expression 'for $i in collection("test.dbxml")/mydoc/* return $i'
    dbxml> print
    <C>hello</C>
    <D>hi</D>
    This duplicates, but the wrong way:
    dbxml> query 'for $i in collection("test.dbxml")/mydoc/* return ($i,$i)'
    4 objects returned for eager expression 'for $i in collection("test.dbxml")/mydoc/* return ($i,$i)'
    dbxml> print
    <C>hello</C>
    <C>hello</C>
    <D>hi</D>
    <D>hi</D>
    dbxml> query 'for $j in (1,2) for $i in collection("test.dbxml")/mydoc/* return $i'
    4 objects returned for eager expression 'for $j in (1,2) for $i in collection("test.dbxml")/mydoc/* return $i'
    dbxml> print
    <C>hello</C>
    <D>hi</D>
    <C>hello</C>
    <D>hi</D>
    And, finally, for your last string example:
    dbxml> query 'for $i in collection("test.dbxml")/mydoc/C for $j in collection("test.dbxml")/mydoc/D return concat("<C>",$i,"</C>", "<D>", $j, "</D>")'
    1 objects returned for eager expression 'for $i in collection("test.dbxml")/mydoc/C for $j in collection("test.dbxml")/mydoc/D return concat("<C>",$i,"</C>", "<D>", $j, "</D>")'
    dbxml> print
    <C>hello</C><D>hi</D>
    I don't get the 'id' change though.
    I hope this helps.
    -g

  • Redresser à partir d'XML

    Bonjour,
    Je rencontre un problème avec la fonction redresser à partir d'XML sous labview 2011.Sur un contrôleur PXI, le projet fonctionne et après lecture du fichier, l'extraction des données XML est effectuée correctement. Le même projet, copié, sur un autre contrôleur PXI avec labview 2011, la fonction redresser à partir d'XML générer l'erreur 1108 et les données XML issues du même fichier sont toutes à 0. 
    Je ne vois pas de solution.
    Cordialement

    Bonjour,
    Merci d'avoir posté votre question sur les forums de National Instruments.
    La section du forum dans laquelle vous avez posté cette question est une section internationnale. Vous devriez donc poster votre question en anglais si vous souhaitez avoir une réponse rapide.
    Vous pouvez également poster votre question dans la partie française du forum.
    En ce qui concerne votre problème, j'aurais besoin de plus de précisions pour pouvoir vous aider au mieux.
    Sur la machine où le problème se produit, êtes vous sûr que les fonctions XML de LabVIEW sont correctement installées ?
    De quelle manière avez vous copié votre projet, êtes vous sûr d'avoir bien tous les éléments ?
    De quels contrôleurs parlez-vous, est ce que ce sont tous les deux les mêmes ou non ?
    Pourriez-vous poster un exemple simple reproduisant le problème afin que je puisse étudier votre code et éventuellement reproduire le problème ?
    Je vous remercie par avance pour vos réponses.
    Bien cordialement,
    Guillaume H.
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    >> NIDays 2011, le mardi 8 février au CNIT de Paris La Défense

  • Cant read a part of  xml file using AS3

    Hi
    i can read everything from my xml file except a part that i can always get teh first items of each category (it will make more sence in a sec)
    So here is my xml
    [HTML]<?xml version="1.0" encoding="UTF-8"?>
    <flashxml>
      <second_page>
        <sp text="ss ptextj"/>
        <ss text="sptext"/>
        <clas text="clas"/>
      </second_page>
      <third_page>
        <ss>
          <category name="categor">
            <item>3333</item>
            <item>H4444</item>
            <item>etc etc etc </item>
          </category>
          <category name="security ">
            <item>SSL</item>
            <item>Hacke</item>
            <item>etc etc etc </item>
          </category>
        </ss>
        <sp>
          <category name="security a">
            <item>SSL lallalala</item>
            <item>Hacker</item>
            <item>etc etc etc </item>
          </category>
          <category name="onlin">
            <item>Hussle free</item>
            <item>Diafore</item>
            <item>etc etc 2 </item>
          </category>
        </sp>
        <classifieds>
          <category name="Best">
            <item>Additem1</item>
            <item>Additem2</item>
            <item>Additem3 </item>
          </category>
        </classifieds>
      </third_page>
    </flashxml>[/HTML]
    I am trying for each category in the xml to get the relevant items ...
    The problem is that if i try to read for e.g the second set of items for the second category of <sp> using a counter it throws a type error
    TypeError: Error #1010: A term is undefined and has no properties.
    at MethodInfo-1()
    at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/flash.net:URLLoader::onComplete()
    so the following works
    var itemslist:XMLList = xml.third_page.ss.category[0].item;  (it will always display the first items of the first category for all the categories
    so for instance for sp will always return even for the second category
    <item>SSL lallalala</item>
            <item>Hacker</item>
            <item>etc etc etc </item>
    but when i am using
    var itemslist:XMLList = xml.third_page.ss.category[i].item;
    i am getting the type error above TypeError: Error #1010 .. (no idea why)
    Any help will be much appreciated
    complete code ::
    pp.buttonMode = true;
    pp.addEventListener(MouseEvent.ROLL_OVER, onButtonOver);
    pp.addEventListener(MouseEvent.CLICK, onButtonOut);
    function onButtonOver(e:MouseEvent):void
    e.currentTarget.gotoAndPlay("a");
    var xmlString:URLRequest = new URLRequest("ev.xml");
    var xmlLoader:URLLoader = new URLLoader(xmlString);
    xmlLoader.addEventListener("complete", init);
    function init(event:Event):void{
      var xDoc:XMLDocument = new XMLDocument();
      xDoc.ignoreWhite = true;
      var animalsXML:XML = XML(xmlLoader.data);
       //var list:XML = XML(xml Loader.data);
    // trace (animalsXML);  //prints the xml
      //edooooooooooooooooooooooooooooooooooo
    var  xml = XML(xmlLoader.data); 
               trace ("XML File");  
           trace ("===================");  
               trace (xml.second_page.sp.attribute("text"));   
          trace (xml.second_page.ss.attribute("text"));   
          trace (xml.second_page.clas.attribute("text"));   
      //edoooooooooooooooooooooooooooooooooooooooooooooooooooo
    // Third page ss
       var i = 0;
       var categorylist:XMLList = xml.third_page.ss.category;  
              for each (var captionElement:XML in categorylist)  
         i++;
                   trace (captionElement.attribute("name")); 
        //trace (captionElement.item);
        var itemslist:XMLList = xml.third_page.ss.category[0].item;
        for each (var captionElement:XML in itemslist)  
                    trace(captionElement);
      // trace (valueOf(captionElement.item));
    // Third page sp
       var i = 0;
       var categorylist:XMLList = xml.third_page.sp.category;  
              for each (var captionElement:XML in categorylist)  
         i++;
                   trace (captionElement.attribute("name")); 
        //trace (captionElement.item);
        var itemslist:XMLList = xml.third_page.sp.category[0].item;
        for each (var captionElement:XML in itemslist)  
                    trace(captionElement);
      // trace (valueOf(captionElement.item));
    // Third page clas
      var i = 0;
       var categorylist:XMLList = xml.third_page.classifieds.category;  
              for each (var captionElement:XML in categorylist)  
    i++;
               trace (i);
         trace (captionElement.attribute("name"));
        //   trace (captionElement.item);
      // trace (valueOf(captionElement.item));
        //var hi= captionElement.attribute("name");
    var itemslist:XMLList = xml.third_page.classifieds.category[0].item;
        for each (var captionElement:XML in itemslist)  
                    trace(captionElement);
      // trace (valueOf(captionElement.item));
      for each(var itemData:XML in animalsXML.elements()) {
    //  trace(itemData.elements().attribute("text")); //DOULEUI
    //third page
    //itemData.thirdpage.elements()[0].@patty
      xDoc.parseXML(animalsXML.toXMLString());
    // trace(xDoc.firstChild.childNodes[0]); //Riverside
      //trace(xDoc.firstChild.childNodes[0].nodeValue);
    //trace(xDoc.valueOf(.getElementsByTagName("item")[0].childNodes[0].nodeValue);
    function onButtonOut(e:MouseEvent):void
    e.currentTarget.gotoAndPlay("b");
    pb.gotoAndPlay("a");

    use
    var itemslist:XMLList = captionElement.item;
    instead of
    var itemslist:XMLList = xml.third_page.sp.category[0].item;
    that should work. You already got the category node in your captionElement variable, why not just use it instead of looking it up again in the document tree?

  • SQLException while selecting only part of XML document

    Hi,
    I'm newbie in oracle XML DB. I'm trying to make an example application but I'm still getting an SQLException while selecting only part of my XML document. I'm using oracle 11g release 1.
    I have following XML document:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <CATALOG>
    <CD>
    <TITLE>Empire Burlesque</TITLE>
    <ARTIST>Bob Dylan</ARTIST>
    <COUNTRY>USA</COUNTRY>
    <COMPANY>Columbia</COMPANY>
    <PRICE>10.90</PRICE>
    <YEAR>1985</YEAR>
    </CD>
    <CD>
    <TITLE>Hide your heart</TITLE>
    <ARTIST>Bonnie Tyler</ARTIST>
    <COUNTRY>UK</COUNTRY>
    <COMPANY>CBS Records</COMPANY>
    <PRICE>9.90</PRICE>
    <YEAR>1988</YEAR>
    </CD>
    </CATALOG>
    and following java code:
    import oracle.jdbc.OraclePreparedStatement;
    import oracle.jdbc.OracleResultSet;
    import oracle.xdb.XMLType;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    public class Select {
    private static String SQL_1 = "SELECT OBJECT_VALUE FROM CATALOG";
    private static String SQL_2 = "SELECT extract(OBJECT_VALUE,'/CATALOG/CD/ARTIST') FROM CATALOG";
    public static void main(String[] args) throws SQLException {
    Connection conn = createConnection();
    OraclePreparedStatement stmt = (OraclePreparedStatement) conn.prepareStatement(SQL_1);
    OracleResultSet orset = (OracleResultSet)stmt.executeQuery();
    while (orset.next()) {
    // get the XMLType
    XMLType poxml = XMLType.createXML(orset.getOPAQUE(1));
    // get the XMLDocument as a string...
    System.out.println(poxml.getStringVal());
    conn.close();
    private static Connection createConnection() {
    try {
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Connection conn =
    DriverManager.getConnection("jdbc:oracle:thin:@hruby.marbes.cz:1521:oracle", "hruby", "password");
    return conn;
    } catch (SQLException e) {
    e.printStackTrace();
    return null;
    While executing SQL_1 statement everything goes well and I get whole document.
    While executing SQL_2 statement I get following exception:
    Exception in thread "main" java.sql.SQLException: Only LOB or String Storage is supported in Thin XMLType
         at oracle.xdb.XMLType.processThin(XMLType.java:2817)
         at oracle.xdb.XMLType.<init>(XMLType.java:1238)
         at oracle.xdb.XMLType.createXML(XMLType.java:698)
         at oracle.xdb.XMLType.createXML(XMLType.java:676)
         at Select.main(Select.java:27)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
    I expect to get such result:
    <ARTIST>Bob Dylan</ARTIST>
    <ARTIST>Bonnie Tyler</ARTIST>
    any suggestion???
    Thanks

    OBJECT_VALUE in this case refers to an XMLType datatype (fragment due to the use of "extract"). Convert it on "the fly" to a CLOB using getCLOBVal(). Then pick it up in java as a LOB.

  • Search on a part of XML

    I have a XML file in my web project like this;
    <StringResources>
    <Control Id="ctrl1">
    <Item key="lblName.Text" value="Name1"/>
    <Item key="lblAge.Text1" value="23"/>
    </Control>
    <Control Id="ctrl2">
    <Item key="lblAddress.Text" value="Address :"/>
    <Item key="lblCity.Text" value="City :"/>
    </Control>
    <Control Id="ctrl3">
    <Item key="lblName.Text" value="Name2"/>
    <Item key="lblAge.Text" value="19"/>
    </Control>
    </StringResources>
    Ist I want to generate a sub XML from above main XML like
    this;
    <Control Id="ctrl1">
    <Item key="lblName.Text" value="Name1"/>
    <Item key="lblAge.Text1" value="1111"/>
    </Control>
    I did it by using following code;
    <cfset resourceFileName = "Resources/Strings.xml">
    <cffile action="read"
    file="#ExpandPath('#resourceFileName#')#"
    variable="resourceXmlDoc">
    <cfset controlsResources = XmlParse(resourceXmlDoc)>
    <cfset controlResourcesAry = XmlSearch(controlsResources,
    "//StringResources/Control[@Id='ctrl1']")>
    <cfset
    Variables.controlResources=controlResourcesAry[1]>
    Now when I dump "Variables.controlResources" I can see the
    correct XML segment.
    But when I search that XML segment using a attribute name
    which is not exist in that segment (but exist in main XML), I get
    the correct value for that attribute;
    For instance I get the answer for following code as "Address
    :", eventhough "lblAddress.Text" is not available in
    "Variables.controlResources".
    <cfset result = XmlSearch(Variables.controlResources,
    "//Control/Item[@key='lblAddress.Text']")>
    <cfreturn result[1].xmlAttributes.value>
    Can someone please help me on this.
    Thanks in advance.

    Hi,
    Regarding not mixing ADF security, I checked and the ADFBC demo, which I picked up, uses J2EE container (it uses file-based xml security file). So, I think I am ok. I have set jbo.security to "None," not "Must". Is that what you meant?
    SRDemo uses the default REALM LoginModule, not a custom LoginModule. This works with ADF BC security, with custom LoginModules I doubt that this works (will check as soon as I have some spare time for this)
    07/04/13 12:00:26 INFO: SecuritySensitive.lookupException password is not available for indirect password via application context (user: DataBase_User_orkvjTR8T7NjoLgd7B3Bxak13VTZMtQ2)
    Okay, lets trick the system: Create a user in the jazn-data.xml file e.g. myauthuser and give him a password. Then change the password indirection name DataBase_User_orkvjTR8T7NjoLgd7B3Bxak13VTZMtQ2 to myauthuser. Make sure OC4J is stopped and run the application. This now should work then
    Frank

  • Re: extract part  of xml with SAX

    alternatively do a XLST to extract the required node?

    would that be possible if i'm using the xerces sax2 parser to extract data?

  • Reading XMl file from ABAP

    Hi friends,
    I am working in SAP 4.6c. Please help me in the following scenario.
    I have to read the xml whixjh in the application server.
    I have to Make sure each XML only contains 1 IDOC.  If 10 idocs are pushed out , there should be 10 XML messages.  1 idoc per XML.
    So if the FM receives a message that contains 10 idocs, the routine just needs to split the XML into 10 separate XML's using YYYYMMDDHHMMSS_IDOCNUMBER.XML as the new of each XML.
    Convert the XML into UTF-8 compliant
    above is my requirement.
    Can you guide me how to read a XMl file and findout how many idocs are present in that...
    Please guide me...
    Thanks in advance,
    Sudha

    Hi Sudha,
    Refer this blog and thread to get more information on how to process XML documents.
    /people/thomas.jung3/blog/2004/06/24/bsp-150-a-developer146s-journal-part-v-xml-for-rfcs
    redaing an XML file to an internal table
    Regards,
    Uma
    Message was edited by: Uma Maheswari

  • Dúvida leitura do XML B2B

    Bom dia pessoal,
    Estou com uma dúvida aqui:
    Estamos implementando o cenário B2B para notas de entrada. O cenário NFB2B_WebAS_Inbound_B2B_NFe, será implementado para pegar arquivos XML de um diretório X da rede.
    Gostaria de confirmar se, os dados do XML serão armazenados diretamente na tabela /XNFE/XMLIN. O proxy para este cenário está implementado diretamente pelo pacote SLL-NFE ?
    Precisaremos também, dar entrada nas NFes a partir dos XMLs. Será necessário fazer um XSLT Transformation para utilizar os dados armazenados na string da tabela /XNFE/XMLIN (para enviá-los ao R/3) ?
    Estamos na versão 1.0.
    Abraços e muito obrigada,
    Luciana Rossan

    Olá Luciana,
    sim, existe um proxy standard para entrada (recebimento) dos XMLs no NFE 1.0 e, sim, se vc entra o XML por esse proxy ele já armazena o documento.
    Quanto à entrada no ERP, aconselho a considerar  a implementação do SAP NFE Incoming (módulo de recebimento automatico) incluído no NFE 10.0. Veja mais detalhes aqui:
    Abs,
    Henrique.

  • Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the problem persists, contact your Web server administrator.

    We unable to display web part. It shows  below error web part error:
    Error while executing web part: System.Xml.XmlException: Root element is missing.     at System.Xml.XmlTextReaderImpl.Throw(Exception e)     at System.Xml.XmlTextReaderImpl.ParseDocumentContent()     at
    Microsoft.SharePoint.WebControls.XmlUrlDataSource.FetchData(String requestUrl)     at Microsoft.SharePoint.WebControls.BaseXmlDataSource.Execute(String request)     at Microsoft.SharePoint.WebControls.BaseXmlDataSource.GetXmlDocument()
        at Microsoft.SharePoint.WebControls.SingleDataSource.GetXPathNavigatorInternal()     at Microsoft.SharePoint.WebControls.SingleDataSource.GetXPathNavigator()     at Microsoft.SharePoint.WebPartPages.DataFormWebPart.GetXPathNavigator(String
    viewPath)     at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform(Boolean bDeferExecuteTransform)
    could any one give me solution on this.
    Regards
    Ravi kumar
    ravi sharepoint

    HI 
    I got below error in that webpart.
    5/28/2014 6:21 AM
    w3wp.exe (0x1F04)
    10176
    SharePoint Foundation
    Monitoring
    High
    Leaving Monitored Scope (EnsureListItemsData). Execution Time=38.95746526444
    5/28/2014 7:04 AM
    w3wp.exe (0x1F04)
    10452
    SharePoint Foundation
    General
    High
    The user does not exist or is not unique.
    5/28/2014 7:04 AM
    w3wp.exe (0x1F04)
    10452
    SharePoint Foundation
    Monitoring
    High
    Leaving Monitored Scope (DataBinding DataFormWebPart (MCH Projects View Web Part)). Execution Time=1696.60494560063
    I got below logs message sharepoint log investigation tool.
    Let us know any suggestions on this.
    ravi sharepoint

  • PL/SQL procedure to process XML file

    I am just starting to work on xml, and we are using PL/SQL stored procedures to process xml file. I did find the sample code in the package (family.sql). This sample print out all element names and attributes. My questions are :
    (1) I tried to modify the code to print out the element values (or Node values). Here is the code:
    -- get all elements and values
    nl := xmlparser.getElementsByTagName(doc, '*');
    len := xmlparser.getLength(nl);
    -- loop through elements
    for i in 0..len-1 loop
    n := xmlparser.item(nl, i);
    dbms_output.put_line('NodeName: ' &#0124; &#0124; xmlparser.getNodeName(n) &#0124; &#0124; ' ');
    dbms_output.put_line('NodeValue: ' &#0124; &#0124; xmlparser.getNodeValue(n) &#0124; &#0124; ' ');
    end loop;
    However, it did not print out the values, although it did print out the name. what's wrong with it? how can I get the value?
    (2) I have the following xml file:
    <?xml version="1.0"?>
    <profile>
    <id>1</id>
    <name>Company</name>
    <des>master profile</desc>
    <subprofile>
    <subid>1</subid>
    <subname>group1</subname>
    <subdesc>group profile</subdesc>
    </subprofile>
    </profile>
    now, I'd like to print out all the children of the <subprofile> node, that is <subid>, <subname> and <subdesc>. Here is my code:
    -- get subprofile nodelist
    qnlist := xmlparser.getElementsByTagName(doc, 'subprofile');
    -- get length of the nodelist
    len := xmlparser.getLength(qnlist);
    -- loop through elements
    for i in 0..len-1 loop
    qnode := xmlparser.item(qnlist, i);
    qnnode := xmlparser.getFirstChild(qnode);
    qnchild := xmlparser.getFirstChild(qnnode);
    dbms_output.put_line(xmlparser.getNodeName(qnnode));
    dbms_output.put_line(xmlparser.getNodeValue(qnchild));
    LOOP
    if (xmlparser.isNULL(xmlparser.getNextSibling(qnnode))) then exit;
    END IF;
    qnnode := xmlparser.getNextSibling(qnnode);
    qnchild := xmlparser.getFirstChild(qnnode);
    dbms_output.put_line(xmlparser.getNodeName(qnnode));
    dbms_output.put_line(xmlparser.getNodeValue(qnchild));
    END LOOP;
    end loop;
    when I execute the procedure, I get the following output:
    #text
    I am not sure what's wrong with it. Basically, I didn't know the procedure to traverse the tree since here it's a little different from OO programming. Could someone give a sample code which demonstrate the procedure which can get a specific element's name and values? (for my exapmle, the name and value of the <subname>, or <subid>, <subdesc>).
    Also, is there a way to insert a part of xml file into a DB table? in my case, insert the subprofile into a table. I know the xmlgen package has a procedure to insert a xml file into a table, but not a part of xml. And can I insert a xml file into several tables instead of one table, using xmlgen package?
    looking forward to hearing from you. any suggestion and sample code would be helpful. thank you very much.
    null

    I sloved my first question: to get the Nodevalue, I need to use getFirstChild(n);
    But, I still didn't figure out the second
    problem. Actually, It works when I modified my xml file as following:
    <?xml version="1.0"?>
    <profile>
    <id>1</id>
    <name>Company</name>
    <des>master profile</desc>
    <subprofile><subid>1</subid><subname>group1</subname><subdesc>groupprofile</subdesc></subprofile>
    </profile>
    All the <subprofile>....</subprofile> must be in one line without any return. This is unbelievable! It suppose that xml does not matter new lines. I tested my code, it seems space is fine, but new line. Something must be wrong in my code.
    please give any suggestion. Thanks,
    Yudong
    null

  • XML to ABAP internal table conversion

    Hi Guys,
      Via debugging,I downloaded the context of an ABAP webdynpro application into an XML file on my desktop. Now I want to use this file as an input to a FM. This is what I have done for it
    1) Used the GUI_UPLOAD fm to convert the xml file on my desktop into xstring
    2)  used transformation like this
      CALL TRANSFORMATION id
      SOURCE xml  = ls_xml_xstring
      RESULT para = lt_result.
    lt_result is of the type that the FM input expects
    step 2 does not work. I know I am missing something there. Pls tell me what it is. Its a huge file and I dont want to manually create the input.
    BR,
    Girish

    Hi,
    Have you seen this weblogs which talks about this:
    /people/r.eijpe/blog/2005/11/10/xml-dom-processing-in-abap-part-i--convert-an-abap-table-into-xml-file-using-sap-dom-approach
    /people/r.eijpe/blog/2005/11/21/xml-dom-processing-in-abap-part-ii--convert-an-xml-file-into-an-abap-table-using-sap-dom-approach
    /people/r.eijpe/blog/2006/02/19/xml-dom-processing-in-abap-part-iiia150-xml-dom-within-sap-xi-abap-mapping
    /people/r.eijpe/blog/2006/02/20/xml-dom-processing-in-abap-part-iiib150-xml-dom-within-sap-xi-abap-mapping
    Hope this helps you....
    Regards
    Nishant Malhotra

Maybe you are looking for

  • Windows Update 80072EE2 after Factory recovery

    Hello everyone!    I just did a complete factory recovery on a Lenovo 3000 K100, with Windows Vista Home Premium 32bits. The recovery was successeful. (I used the Recovery partition that came from the Lenovo) The device manager has nothing wrong. But

  • I can't use the cut tool above the primary timeline...

    I can't use the cut tool above the primary timeline... it only works on the primary timeline. why and what can I do? thanks

  • How to build a cluster array dynamically from another cluster array?

    I'm working on a problem where I seem to be getting lost in a sea of possibilities, none of which strikes me as optimum. Here's what I need to do. I've got an input array of clusters (ARR1). Each cluster contains the following components: an integer

  • Why RandomAccessFile inserts space before each character while writing?

    Ater running the following code, the file test.txt contain: a b c d e f g h i j k l m n o p q r s t u v w x y z Why writeChars() inserted a space before each charecter? How to avoid this unwanted insertion? try { RandomAccessFile raf = new RandomAcce

  • Adding a movieclip to AlivePDF

    Hi everyone, I am wrapping my head around AlivePDF. I can't seem to find an aswer to this question. Can I add a movieclip as the data to include inside the page? I have it so that the PDF generates text from specific text fields, but I want it to sho