To read xsl values of subsequent nodes in xml document

Hi,
I have a xml document which looks something like this
<report>
<prelist>
<row>
<field name="learning" value="Internet basics"/>
</row>
<row>
<field name="learning" value="General Knowlege"/>
</row>
</prelist>
<list>
<row>
<field name="learning" value="Internet basics"/>
<field name="tool" value="xml"/>
</row>
<row>
<field name="learning" value="Internet basics"/>
<field name="tool" value="xmlxsl"/>
</row>
<row>
<field name="learning" value="General Knowledge"/>
<field name="tool" value="xmltool"/>
</row>
</list>
</report>
What i would like to do is
I read the prelist structure and retrieve the value of "learning"
For each value i retrieve i would like to read the list structure for similar values
e .g in first iteration i get the value = "Internet Basics" from prelist node then from list node i would like tool node with value = "xml" and value="xmlxsl"
Please let me know if this is possible and nay help would be appreciated..
Thanks.

I don't see how you go from the prelist to the list but I guess that doesn't matter.
You can load the XML into a DOM document then use the Document method:
getElementsByTagName
public NodeList getElementsByTagName(String tagname)
Returns a NodeList of all the Elements with a given tag name in the order in which they are encountered in a preorder traversal of the Document tree.
Parameters:
tagname - The name of the tag to match on. The special value "*" matches all tags. Returns:
A new NodeList object containing all the matched Elements.

Similar Messages

  • How to read the content in one node of XML in Java? Pls help

    My dear brothers,
    I am a newbie of XML, I have a exercise which is creating a Tree View from XML file. But the trouble is I do not know how to read the content in one node of XML file. I decide to use the algorithm as following:
    1. Create a GUI form which gives the ability for user to choose a XML file (ok)
    2. Load XML and return the file (ok)
    3. Read the file from node to node to create the node in Tree View (?!)
    Please help me, and if you are enough kind, please give me an small example to easy understand. Thanks in advance.
    Hoang Yen Binh

    I hope this one helps you.
         <ABC Type="ProductBased" ProdName="One" Location="India">
              <CEO>Raj</CEO>
              <Finance>Vikram</Finance>
              <HR>Karthik</HR>
              <Technical>Satish</Technical>
         </ABC>
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.NamedNodeMap;
    import org.w3c.dom.Attr;
    import org.w3c.dom.NodeList;
    import org.w3c.dom.Node;
    import org.w3c.dom.DOMException;
    import javax.xml.parsers.ParserConfigurationException;
    import org.xml.sax.SAXException;
    import java.io.File;
    import java.io.IOException;
    public class XmlReading {
         Document doc;
         Element element;
         public static void main(String[] args) throws Exception{
              XmlReading xr = new XmlReading();
              xr.getXmlParser(args);
         public void getXmlParser(String[] args) {
              DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                   if(args.length != 1) {
                        System.err.println("Argument Required");
              try {
                   DocumentBuilder builder = factory.newDocumentBuilder();
                   doc = builder.parse(new File(args[0]));
              }catch(ParserConfigurationException e1) {
              }catch(SAXException e2) {
              }catch(IOException e3) {
              getAttributes();
         public void getAttributes() {
              // Retrive the entire Document from the Dom Tree
              element = doc.getDocumentElement();
    //          System.out.println(element);
              NamedNodeMap attrs = element.getAttributes();
              // Get number of attributes in the element
         int numAttrs = attrs.getLength();
         // Process each attribute
              for (int i=0; i<numAttrs; i++) {
                   Node node = attrs.item(i);
                   // Get attribute name and value
                   String attrName = node.getNodeName();
                   String attrValue = node.getNodeValue();
                   System.out.println(attrName + ": " + attrValue);
              String s1 = element.getTagName();
              System.out.println(s1);
              // To get all the elements in a DOM Tree
              NodeList nl1 = element.getElementsByTagName("*");
              int i2 = nl1.getLength();
              System.out.println(i2);
              for(int i=0; i<i2; i++) {
                   System.out.println(nl1.item(i) + "\n");
    }

  • Need to chart attribute value of just one child node of XML document

    I have a XML document with (for example) 7 parent nodes, each
    parent node has 5 child nodes. The parent nodes have an attribute
    @EarlierDTS (DateTime type) that is the x-axis category of a chart.
    Each child node has an attribute @eventid which specifies the id of
    the event, and another atttribute @NumOccurs which specifies how
    many times that event occured in that period.
    How do I tell Flex I want a simple line chart of the eventID
    = 215? What if I want two lines, for both eventID=215 and
    eventid=307?
    I have studied the posts and blogs for over a week now, and
    have seen this question or similar come up quite a few places, with
    no answer.
    1) Should I focus on learning how to create a filterfunction
    for the XMLList that underlies my XMLListCollection so that the
    filtered data view is just one child node per parent node ( or two
    child nodes for the second case)? And set the filtered data view as
    the dataprovider of my chart's vertical series?
    2) Should I focus on learning how to create a XML Filter
    query that selects just one or two child nodes for each parent
    node, and set the charts' series' dataprovider to this filter
    expression? (I don't think this is allowed - but I'm checking with
    the forum members...)
    3) Should I focus on learning how to convert the
    XMLListCollection into a HierarchicalData object, and then learning
    how to filter this object so there is only one (or two) childs per
    parent? This seems like a lot of coding - I almost have to create a
    pair of classes - one for the parent and one for the child - so I
    can create nested ArrayObjects.
    4) Should I create a brand new XMLList by walking the
    original XML list, and inserting Parent nodes and just the child
    nodes that match the eventID(s) I want to chart, into the new
    XMLList?
    I believe that the easiest way would be to create a
    Filterfunction for the XMLList, and bind the chart series to the
    (filtered) XML List. But the problem with this approach is that I
    have seen more than 2 posts asking how to accomplish filtering that
    removes specific children from the view, with no solutions posted.
    Help! What is the best way to get just one child for each
    parent, from an XMLList?

    "whertzing" <[email protected]> wrote in
    message
    news:[email protected]...
    >I have a XML document with (for example) 7 parent nodes,
    each parent node
    >has 5
    > child nodes. The parent nodes have an attribute
    @EarlierDTS (DateTime
    > type)
    > that is the x-axis category of a chart. Each child node
    has an attribute
    > @eventid which specifies the id of the event, and
    another atttribute
    > @NumOccurs
    > which specifies how many times that event occured in
    that period.
    >
    > How do I tell Flex I want a simple line chart of the
    eventID = 215? What
    > if I
    > want two lines, for both eventID=215 and eventid=307?
    >
    > I have studied the posts and blogs for over a week now,
    and have seen this
    > question or similar come up quite a few places, with no
    answer.
    >
    > 1) Should I focus on learning how to create a
    filterfunction for the
    > XMLList
    > that underlies my XMLListCollection so that the filtered
    data view is just
    > one
    > child node per parent node ( or two child nodes for the
    second case)? And
    > set
    > the filtered data view as the dataprovider of my chart's
    vertical series?
    >
    > 2) Should I focus on learning how to create a XML Filter
    query that
    > selects
    > just one or two child nodes for each parent node, and
    set the charts'
    > series'
    > dataprovider to this filter expression? (I don't think
    this is allowed -
    > but
    > I'm checking with the forum members...)
    >
    > 3) Should I focus on learning how to convert the
    XMLListCollection into a
    > HierarchicalData object, and then learning how to filter
    this object so
    > there
    > is only one (or two) childs per parent? This seems like
    a lot of coding -
    > I
    > almost have to create a pair of classes - one for the
    parent and one for
    > the
    > child - so I can create nested ArrayObjects.
    >
    > 4) Should I create a brand new XMLList by walking the
    original XML list,
    > and
    > inserting Parent nodes and just the child nodes that
    match the eventID(s)
    > I
    > want to chart, into the new XMLList?
    >
    > I believe that the easiest way would be to create a
    Filterfunction for the
    > XMLList, and bind the chart series to the (filtered) XML
    List. But the
    > problem
    > with this approach is that I have seen more than 2 posts
    asking how to
    > accomplish filtering that removes specific children from
    the view, with no
    > solutions posted.
    >
    > Help! What is the best way to get just one child for
    each parent, from an
    > XMLList?
    I'd just look at a dataFunction. There's an example here that
    may point you
    in the right direction:
    http://flexdiary.blogspot.com/2008/08/charting-example.html
    HTH;
    Amy

  • Again and Again. Set Value to node of XML document

    I've read many topics about how to set value in XML, but nothing works. Please, help
    My xml file:
    <TempEditData>
         <parameter userId="testUserId">
              <connectUrl>http://cognoslink</connectUrl>
              <connectUser>cognosTestUser</connectUser>
              <connectPwd>cognosPassword</connectPwd>
              <connectNamespace>cognosNamespace</connectNamespace>
              <reportStorePath>reportStorePath</reportStorePath>
              <reportUrlPath>reportUrlPath</reportUrlPath>
              <reportLifeLength>reportLifeLength</reportLifeLength>
         </parameter>
    </TempEditData>My code:
    private static void storeChartDataBeanParameters( String inputUserId) throws Exception{
              boolean isUserIdInFile = false;
              //create object
              DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
            Document doc = docBuilder.parse (new File("src/tempCognosEditData.xml"));
            //normalize
            doc.getDocumentElement().normalize ();
            //get all Nodes
            NodeList listOfParameters = doc.getElementsByTagName("parameter");
            for(int i=0; i< listOfParameters.getLength(); i++){
                 Node firstParameterNode = listOfParameters.item(i);
                 //if first element is NODE
                if(firstParameterNode.getNodeType() == Node.ELEMENT_NODE){
                    Element firstParameterElement = (Element)firstParameterNode;
                    String userId = firstParameterElement.getAttribute("userId");
                    //if !inputUserId
                    if(!inputUserId.equals(userId)){
                         continue;
                    //if userId was found in file
                    else{
                         isUserIdInFile = true;
                         System.out.println("((Element)firstParameterElement).getElementsByTagName('connectUrl').item(0).getNodeName = " + ((Element)firstParameterElement).getElementsByTagName("connectUrl").item(0).getNodeName());
                         System.out.println("((Element)firstParameterElement).getElementsByTagName('connectUrl').item(0).getNodeValue = " + ((Element)firstParameterElement).getElementsByTagName("connectUrl").item(0).getNodeValue());
                         ((Element)firstParameterElement).getElementsByTagName("connectUrl").item(0).appendChild(doc.createTextNode("dzfgsdfgsdgf"));
                         /*NodeList insideList = firstParameterElement.getElementsByTagName("connectUrl");
                         Element element = (Element)insideList.item(0);
                         System.out.println ( "element.getNodeName() = " + element.getNodeName() );
                         element.setNodeValue("new TT");
                         System.out.println ("element.getNodeValue() = " + element.getNodeValue() );
                         //element.appendChild(doc.createTextNode("rrr"));
                         NodeList nl = element.getChildNodes();
                         System.out.println ("nl.item(0).getFirstChild().getNodeValue() = " + nl.item(0).getFirstChild().getNodeValue());
                         nl.item(0).getFirstChild().appendChild(doc.createTextNode("rrr"));*/
                                    break;
                }//if ELEMENT_NODE
            }//for go through all nodes
         }Edited by: Holod on 03.03.2008 8:58

    So, the solution is pretty easy:
    storeChartDataBeanParameters( String inputUserId) searches for nodes named "+parameter+" in xml file with attribute "+userDd+".
    If method parameter equals to xml data, I perform some operations and save new data.
    The only thing, that saveFile(Document doc) must be syncronized.
    Two users can't write to fie at the same time.
    [This link|http://www.aviransplace.com/2005/03/20/working-with-xml-files-in-java-using-dom/5/] helped me alot.
    Also Dr. Clap posts in different topics brought evidence to my mind.
    private static void storeChartDataBeanParameters( String inputUserId) throws Exception{
              //create object
              boolean isUserIdWasFound = false;
              DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
            Document doc = docBuilder.parse (new File("src/tempCognosEditData.xml"));
            //normalize
            doc.getDocumentElement().normalize ();
            //get all Nodes
            NodeList listOfParameters = doc.getElementsByTagName("parameter");
            for(int i=0; i< listOfParameters.getLength(); i++){
                 Node firstParameterNode = listOfParameters.item(i);
                 //if first element is NODE
                if(firstParameterNode.getNodeType() == Node.ELEMENT_NODE){
                    Element firstParameterElement = (Element)firstParameterNode;
                    String userId = firstParameterElement.getAttribute("userId");
                    //if !inputUserId
                    if(!inputUserId.equals(userId)){
                         continue;
                    //if userId was found in file
                    else{
                         isUserIdWasFound = true;
                         NodeList parameterNode = firstParameterElement.getElementsByTagName("connectUrl");
                         Element connectUrlElement = (Element)parameterNode.item(0);
                         System.out.println("connectUrlElement name = " + connectUrlElement.getNodeName());
                         System.out.println("connectUrlElement value = " + connectUrlElement.getNodeValue());
                         System.out.println("((Node)connectUrlElement) value = "+((Node)connectUrlElement).getNodeValue());
                         ((Node)connectUrlElement.getFirstChild()).setNodeValue("normalized");
                         saveFile(doc);
                         break;
                }//if ELEMENT_NODE
            }//for go through all nodes
         public static void main(String[] args) throws Exception{
              storeChartDataBeanParameters("testUserId");
         public static void saveFile(Document doc) throws Exception{
              Transformer transformer;
              transformer = TransformerFactory.newInstance().newTransformer();
              transformer.transform(new DOMSource(doc), new StreamResult(new File("src/tempCognosEditData.xml")));
         }Edited by: Holod on 03.03.2008 15:52

  • Read XSL-FO file in Flex

    Hi,
          I am trying to read XSL-FO file in flex like XML. but i could not. This file has tags with namespace means (fo:),so i could not find the way to read these tags. Is there anyway i can read XSL-FO File in Flex.
    Example :   <fo:layout-master-set>
    Thanks In Advance.

    I posted an article on how to parse XML structures that use namespaces a while back, please visit this link: http://blog.wisebisoft.com/2009/07/15/parsing-xml-structures-that-use-namespaces/ Since the XLS-FO file is just another XML structure, you should be able to parse it the same way as you'd parse any other XML structure. Good luck.

  • How to read the value of a field belonging to a different context node in GET_I method during runtime

    I want the read the value of a field,'LCSTATUS' belonging to context node 'BTADMINH' in the GET_I method of the field, 'ZZFLD000008' belonging to context node,'ZBTACTIVITYH'.
    In the context node class of context node 'ZBTACTIVITYH',I have created an instance attribute,GR_OWNER type ref to context class.
    I get the following error in the line - lv_act_status = Lr_entity->if_bol_bo_property_access~GET_PROPERTY_AS_STRING( 'LCSTATUS' ).
    'An exception (CX_CRM_CIC_PARAMETER_ERROR) occurred Message no. TPDA430'
    I have used the below code.
    method GET_I_ZZFLD000008.
         DATA: current TYPE REF TO if_bol_bo_property_access,
               lv_act_status TYPE string.
         DATA:lr_entity TYPE REF TO cl_crm_bol_entity,
               lr_current TYPE REF TO if_bol_bo_property_access,
              lr_parent TYPE REF TO cl_crm_bol_entity.
         rv_disabled = 'TRUE'.
         if iterator is bound.
           current = iterator->get_current( ).
         else.
           current = collection_wrapper->get_current( ).
         endif.
    CHECK gr_owner IS BOUND.
    lr_entity ?= gr_owner->btadminh->collection_wrapper->get_current( ).
    CHECK  lr_entity  IS BOUND.
    lv_act_status = Lr_entity->if_bol_bo_property_access~GET_PROPERTY_AS_STRING( 'LCSTATUS' ). "error states that lcstatus can't be used here.
       TRY.
             IF current->is_property_readonly(
                           'ZZFLD000008' ) = abap_false. "#EC NOTEXT
               rv_disabled = 'FALSE'.
             ENDIF.
         CATCH cx_sy_ref_is_initial cx_sy_move_cast_error
               cx_crm_genil_model_error.
           RETURN.
       ENDTRY.
    endmethod.

    Hi,
    LCSTATUS is not an attribute of the BTADMINH structure. It is read using the relation to the status object
    BTADMINH-> BTHeaderStatusSet-> BTStatusHCurrent-> ACT_STATUS.
    Try reading the ACT_STATUS of object BTStatus as given below.
            data: coll   type ref to if_bol_entity_col.
           data: entity type ref to cl_crm_bol_entity,
                         lv_act_status TYPE string.
           entity ?= current.                                                               "BTADMINH entity.
           coll = entity->get_related_entities(
                    iv_relation_name = 'BTHeaderStatusSet' ).    "#EC NOTEXT
           current = coll->get_current( ).
            entity ?= current.
           coll = entity->get_related_entities(
                    iv_relation_name = 'BTStatusHCurrent' ).     "#EC NOTEXT
           current = coll->get_current( ).
            try.
           lv_act_status = current->if_bol_bo_property_access~GET_PROPERTY_AS_STRING(  'ACT_STATUS' ).
             catch cx_crm_cic_parameter_error.
           endtry.
    Regards JP

  • Using dynamic select (xsl:value-of) in XSLT (ABAP)

    Hi folks,
    I did a quite extensive search in the archive but couldn't find an answer on my question. If it has been answered before please just provide me with the link :).
    I need to make a dynamic select in a xsl-value-of in an ABAP XSLT. I do not know the structure of the input message (can be of any kind) and I want to perform a xpath query on the input message. The result of the transformation should be the value (if any) of the xpath query. As the query is not known in before I want to pass the query at runtime using a parameter in XSLT. If I pass my query as a string parameter the value-of just returns the string and not the value of the xpath query. Creating the parameter as a node-set doesn't work either for me.
    So is there any way to use a parameter as input to an xpath query?
    Or is my last resort using a JAVA XSLT processor. This is running inside a ABAP proxy, so a call to JAVA would be a greater hassle.
    Kind regards
    Joscha

    What DB version?
    The following SQL
    select xmltransform(XMLTYPE('<song>
      <title>Isn''t she lovely?</title>
    </song>'), XMLTYPE('<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <xsl:output method="xml" encoding="UTF-8"></xsl:output>
      <xsl:template match="//song">
        <out>
          <xsl:value-of select="title" disable-output-escaping="yes"></xsl:value-of>
        </out>
      </xsl:template>
    </xsl:stylesheet>'))
      from dual;produces this on 11.1.0.6
    <?xml version="1.0" encoding="UTF-8"?>
    <out>Isn't she lovely?</out>and this on 10.2.0.4
    <out>Isn&apos;t she lovely?</out>I found a couple of previous discussions regarding this at
    {thread:id=679397}
    {thread:id=879301}
    The last discussion provides a workaround if you need it.

  • Xsl for removing specific nodes and modifying one node.

    Hello,
    i have the urgent need to remove specific nodes
    and modify one node in my XML.
    the xml as input :
    <?xml version="1.0" encoding="utf-8"?>
    <PLOT>
      <REQUEST>
        <GET_LAYOUT>
          <PROPERTIES>
            <MAPNAME name="xxxx" />
           </PROPERTIES>
          <DATAFRAME id="MAIN">
            <LAYERLIST>
              <LAYERDEF id="0" visible="false" query="" />
              <LAYERDEF id="1" visible="false" query="" />
              <LAYERDEF id="2" visible="false" query="" />
              <LAYERDEF id="3" visible="false" query="" />
              <LAYERDEF id="4" visible="false" query="" />
              <LAYERDEF id="5" visible="false" query="" />
              <LAYERDEF id="6" visible="false" query="" />
              <LAYERDEF id="7" visible="false" query="" />
              <LAYERDEF id="8" visible="false" query="" />
              <LAYERDEF id="9" visible="false" query="" />
              <LAYERDEF id="10" visible="false" query="" />     
            </LAYERLIST>
            <MAPSERVICELIST>   
              <MAPSERVICEDEF  service="BASEMAP" >
                <LAYERLIST>
                  <LAYERDEF id="2" visible="True" query="" />
                  <LAYERDEF id="1" visible="False" query="" />
                </LAYERLIST>
              </MAPSERVICEDEF>
              <MAPSERVICEDEF service="MAP1">
                <LAYERLIST>
                  <LAYERDEF id="4" visible="True" query="" />
                  <LAYERDEF id="3" visible="True" query="" />
                  <LAYERDEF id="2" visible="True" query="" />
                  <LAYERDEF id="1" visible="False" query="" />
                </LAYERLIST>
              </MAPSERVICEDEF>
            </MAPSERVICELIST>
          </DATAFRAME>
        </GET_LAYOUT>
      </REQUEST>
    </PLOT>
    what i want to have is:
    <?xml version="1.0" encoding="utf-8"?>
    <PLOT>
      <REQUEST>
        <GET_LAYOUT>
          <PROPERTIES>
            <MAPNAME name="xxxx" />
          </PROPERTIES>
          <DATAFRAME id="MAIN">
            <LAYERLIST>
       <LAYERDEF id="6" visible="True" query="" />
                <LAYERDEF id="5" visible="True" query="" />
                <LAYERDEF id="4" visible="True" query="" />
                <LAYERDEF id="3" visible="False" query="" />
    <LAYERDEF id="2" visible="True" query="" />
    <LAYERDEF id="1" visible="False" query="" />       
            </LAYERLIST>
            <MAPSERVICELIST/>   
          </DATAFRAME>
        </GET_LAYOUT>
      </REQUEST>
    </PLOT>
    as you see, <MAPSERVICELIST/>   is empty and <LAYERLIST> contains all <LAYERDEF> of <MAPSERVICEDEF>/<LAYERLIST> 
     The ones  of BASEMAP  are kept unchanged  but the ones of MAP1 are having a new attribute value for id.
    Thanks four your help.
    Regards.

    You can implement very straightforward map in BizTalk like below:
    If you are interested in XSLT of this map, I copied below which visual studio gave me when i validated the map:
    <?xml version="1.0" encoding="UTF-16"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var" exclude-result-prefixes="msxsl var" version="1.0">
    <xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />
    <xsl:template match="/">
    <xsl:apply-templates select="/PLOT" />
    </xsl:template>
    <xsl:template match="/PLOT">
    <PLOT>
    <REQUEST>
    <GET_LAYOUT>
    <PROPERTIES>
    <MAPNAME>
    <xsl:if test="REQUEST/GET_LAYOUT/PROPERTIES/MAPNAME/@name">
    <xsl:attribute name="name">
    <xsl:value-of select="REQUEST/GET_LAYOUT/PROPERTIES/MAPNAME/@name" />
    </xsl:attribute>
    </xsl:if>
    <xsl:value-of select="REQUEST/GET_LAYOUT/PROPERTIES/MAPNAME/text()" />
    </MAPNAME>
    <xsl:value-of select="REQUEST/GET_LAYOUT/PROPERTIES/text()" />
    </PROPERTIES>
    <DATAFRAME>
    <xsl:if test="REQUEST/GET_LAYOUT/DATAFRAME/@id">
    <xsl:attribute name="id">
    <xsl:value-of select="REQUEST/GET_LAYOUT/DATAFRAME/@id" />
    </xsl:attribute>
    </xsl:if>
    <LAYERLIST>
    <xsl:for-each select="REQUEST/GET_LAYOUT/DATAFRAME/MAPSERVICELIST/MAPSERVICEDEF">
    <xsl:for-each select="LAYERLIST/LAYERDEF">
    <LAYERDEF>
    <xsl:if test="../../../../LAYERLIST/LAYERDEF/@id">
    <xsl:attribute name="id">
    <xsl:value-of select="../../../../LAYERLIST/LAYERDEF/@id" />
    </xsl:attribute>
    </xsl:if>
    <xsl:if test="@id">
    <xsl:attribute name="id">
    <xsl:value-of select="@id" />
    </xsl:attribute>
    </xsl:if>
    <xsl:if test="../../../../LAYERLIST/LAYERDEF/@visible">
    <xsl:attribute name="visible">
    <xsl:value-of select="../../../../LAYERLIST/LAYERDEF/@visible" />
    </xsl:attribute>
    </xsl:if>
    <xsl:if test="@visible">
    <xsl:attribute name="visible">
    <xsl:value-of select="@visible" />
    </xsl:attribute>
    </xsl:if>
    <xsl:if test="../../../../LAYERLIST/LAYERDEF/@query">
    <xsl:attribute name="query">
    <xsl:value-of select="../../../../LAYERLIST/LAYERDEF/@query" />
    </xsl:attribute>
    </xsl:if>
    <xsl:if test="@query">
    <xsl:attribute name="query">
    <xsl:value-of select="@query" />
    </xsl:attribute>
    </xsl:if>
    </LAYERDEF>
    </xsl:for-each>
    </xsl:for-each>
    <xsl:value-of select="REQUEST/GET_LAYOUT/DATAFRAME/LAYERLIST/text()" />
    </LAYERLIST>
    <MAPSERVICELIST>
    <xsl:text> </xsl:text>
    </MAPSERVICELIST>
    <xsl:value-of select="REQUEST/GET_LAYOUT/DATAFRAME/text()" />
    </DATAFRAME>
    <xsl:value-of select="REQUEST/GET_LAYOUT/text()" />
    </GET_LAYOUT>
    <xsl:value-of select="REQUEST/text()" />
    </REQUEST>
    </PLOT>
    </xsl:template>
    </xsl:stylesheet>
    You can highlight the issue if you have any specific one.
    Please mark it as Answer if this answers your question
    Thanks.
    Mo
    The contents I write here is my personal views, not the view of my employer and anyone else.

  • Problem replacing Null nodes with real values in XML documents...

    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    Our friends in Java land are insisting on passing data between Java and PL/SQL using fairly small XML documents (don't ask). I then need to extract the input parameter values and pass them, on to the stored procedures that actually do the work. These return a result which needs to be returned to the java layer in the output XML document.
    Here is a cut down version of the input XML...
    <ParameterList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Parameter>
    <Id>1</Id>
    <Result xsi:nil="true"/>
    </Parameter>
    <Parameter>
    <Id>2</Id>
    <Result xsi:nil="true"/>
    </Parameter>
    </ParameterList>
    and this is an example of what I am expected to return...
    <ParameterList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Parameter>
    <Id>1</Id>
    *<Result>SUCCESS</Result>*
    </Parameter>
    <Parameter>
    <Id>2</Id>
    *<Result>WARNING</Result>*
    </Parameter>
    </ParameterList>
    i.e. I am expected to replace the value of the Result node with a string indicating the succes or otherwise of the underlying PL/SQL process.
    I am extracting the input values using the DBMS_XMLDOM functions and naively assumed that DBMS_XMLDOM.SETNODEVALUE could be used to update the value in the Result node - It didn't work so I resorted to reading the documentation which revealed that it will not work for a null node.
    Am I going to have to use XSLT to generate the output XML from the Input and incorprate the result? Or is there a simpler way?
    I have used XSLT in Oracle before and still have the nervous tick...

    Thanks A Non,
    With your suggestion and a bit of help from the w3schools.com xml dom tutorial I eventually managed to work out how to do this.
    Here is the code (with all my debug stuff in so it looks worse than it is...)
    create or replace
    PROCEDURE ExtractXMLValues (p_inXml IN CLOB ) IS
    l_string VARCHAR2(4000);
    l_value VARCHAR2(4000);
    l_DOM_doc dbms_xmldom.DOMDocument;
    l_DOM_node dbms_xmldom.DOMNode;
    l_new_DOM_node dbms_xmldom.DOMNode;
    l_new_element dbms_xmldom.DOMElement;
    l_new_DOM_nodevalue dbms_xmldom.DOMNode;
    l_value_Node dbms_xmldom.DOMNode;
    l_parameter_Node dbms_xmldom.DOMNode;
    --l_DOM_nodelist    dbms_xmldom.DOMNodeList;
    l_Result_DOM_node dbms_xmldom.DOMNode;
    BEGIN
    l_DOM_doc := dbms_xmldom.newDomDocument(p_inXml);
    l_DOM_node := dbms_xmldom.makeNode(l_DOM_doc);
    dbms_xmldom.writeToBuffer(l_DOM_node, l_string);
    dbms_output.put_line('1 ' || l_string);
    l_parameter_node := dbms_xslprocessor.selectSingleNode(l_DOM_node,'//Parameter');
    -- get the current values in the XML document for Id and Result
    l_Result_DOM_node := dbms_xslprocessor.selectSingleNode(l_DOM_node,'//Id');
    l_value_Node := dbms_xmldom.getFirstChild(l_Result_DOM_node);
    l_value := dbms_xmldom.getnodevalue(l_value_Node);
    dbms_xmldom.writeToBuffer(l_Result_DOM_node, l_string);
    dbms_output.put_line('2 ' || l_string || ' : ' || l_value);
    l_Result_DOM_node := dbms_xslprocessor.selectSingleNode(l_DOM_node,'//Result');
    l_value_Node := dbms_xmldom.getFirstChild(l_Result_DOM_node);
    l_value := dbms_xmldom.getnodevalue(l_value_Node);
    dbms_xmldom.writeToBuffer(l_Result_DOM_node, l_string);
    dbms_output.put_line('3 ' || l_string || ' : ' || l_value);
    -- create new Result node
    l_new_DOM_node      := dbms_xmldom.makenode(dbms_xmldom.createElement(l_DOM_doc, 'Result'));
    dbms_xmldom.writeToBuffer(l_new_DOM_node, l_string);
    dbms_output.put_line('4 New node : ' || l_string);
    -- create a value for it
    l_new_DOM_nodevalue := dbms_xmldom.makenode(dbms_xmldom.createtextnode(l_DOM_doc, 'SUCCESS'));
    dbms_xmldom.writeToBuffer(l_new_DOM_nodevalue, l_string);
    dbms_output.put_line('5 New node value : ' || l_string);
    -- add the value to the new Result node
    l_new_DOM_nodevalue := dbms_xmldom.appendchild(l_new_DOM_node,  l_new_DOM_nodevalue);
    dbms_xmldom.writeToBuffer(l_new_DOM_node, l_string);
    dbms_output.put_line('6 New node : ' || l_string);
    -- replace the old node with the new one
    l_Result_DOM_node := dbms_xmldom.replaceChild(l_parameter_node, l_new_DOM_node, l_Result_DOM_node);
    dbms_xmldom.writeToBuffer(l_parameter_node, l_string);
    dbms_output.put_line('6 parameter node : ' || l_string);
    dbms_xmldom.writeToBuffer(l_DOM_node, l_string);
    dbms_output.put_line('7 Updated document ' || l_string);
    dbms_xmldom.freeDocument(l_DOM_doc);
    END ExtractXMLValues;
    and the output...
    1 <ParameterList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Parameter>
    <Id>1</Id>
    <Result xsi:nil="true"/>
    </Parameter>
    </ParameterList>
    2 <Id>1</Id> : 1
    3 <Result xsi:nil="true"/> :
    4 New node : <Result/>
    5 New node value : SUCCESS
    6 New node : <Result>SUCCESS</Result>
    6 parameter node : <Parameter>
    <Id>1</Id>
    <Result>SUCCESS</Result>
    </Parameter>
    7 Updated document <ParameterList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Parameter>
    <Id>1</Id>
    *<Result>SUCCESS</Result>*
    </Parameter>
    </ParameterList>
    One question, why do the dbms_xmldom functions return the Old value? I was expecting the returned value to be the updated node.
    Edited by: Lone voice on May 14, 2009 11:24 AM

  • How to read all values of a queue

    Hi All,
    In Message mapping I am checking condition for field value based on incoming value.
    In test cases i can see the second or third  occurence is getting supressed and first value fails the condition and mapping node not created.
    I would like to know how to read multiple values from queue and check condition for each value and if correct value present condition should pass.
    I tried all possible context changes but no luck.
    Any ideas how to read all values coming .
    Thanks.

    <?xml version="1.0" encoding="UTF-8"?>
    <msg version="" dbName="">
       <rowOp isLast="" cmitLSN="" cmitTime="" authID="" correlationID="" planName="">
          <updateRow subName="" srcOwner="" srcName="" intentSEQ="" rowNum="" hasLOBCols="">
             <col name="END_RSN_CDE" isKey="852369" invalidData="" rawData="">
                <smallint>
                   <beforeVal invalidData="" rawData=""/>
                   <afterVal invalidData="" rawData=""/>
                </smallint>
                <date>
                   <beforeVal invalidData="" rawData=""/>
                   <afterVal invalidData="" rawData=""/>
                </date>
                <char>
                   <beforeVal invalidData="" rawData=""/>
                   <afterVal invalidData="" rawData=""/>
                </char>
             </col>
             <col name="SVC_USER_SDT" isKey="789654" invalidData="" rawData="">
                <smallint>
                   <beforeVal invalidData="" rawData=""/>
                   <afterVal invalidData="" rawData=""/>
                </smallint>
                <date>
                   <beforeVal invalidData="" rawData=""/>
                   <afterVal invalidData="" rawData=""/>
                </date>
                <char>
                   <beforeVal invalidData="" rawData=""/>
                   <afterVal invalidData="" rawData=""/>
                </char>
             </col>
          </updateRow>
       </rowOp>
    </msg>

  • XML-22009: (Error) Attribute 'select' not found in 'xsl:value-of'

    Hello,
    I'm a long-time Siebel developer but novice to BIP, trying to enhance some complex rtf templates that an experienced xdo/bip developer (contractor) designed for us in the past, with a couple of new fields that have been added to the integration object.
    All templates and sub-templates receive 'no errors found' when using add-in tool selection of 'Validate Template'. Unfortunately we cannot utilize the 'preview' capability due to the way the sub-templates are called, so only way to test is to upload into server and attempt to run real-time.
    This results in UI error of SBL-OMS-00203, which when we dig into the xdo log file turns out to be:
    <Line 648, Column 88>: XML-22009: (Error) Attribute 'select' not found in 'xsl:value-of'.
    I have exported all templates and sub-templates into XSL-FO Style Sheet and looked at line 648 column 88, and none of them seem to correspond to this line/column combination (in fact most exports do not even go that high in lines).
    Googling 'XML-22009' hasn't proven to be of much help, so reaching out to the xdo experts in this forum.
    How are the line/column #'s determined in the xdo log output?
    I am pretty sure that it must be some issue with my 'Main' template, since none of the sub-templates have been changed (and the current version of the report, without the new fields incorporated, still runs fine from the UI). In the XSL-FO format export of the (modified, with new fields added) 'Main.rtf' file, line 648 places it right in the midst of a bunch of hex which corresponds to an imbedded image (which was also part of the existing template, no change there) and that line only has 65 columns (i.e. doesn't even go up to 88), so I'm questioning how valid the Line/Column information is in the xdo log error message.
    Any hints on troubleshooting this one would be greatly appreciated!
    Thanks & Regards,
    Katrina

    Hi,
    as I wrote in the inital message, we even left out the output method or used "application/pdf". The result is unfortunately always the same. And I still claim this is not a problem with the stylesheet itself, it has to do something with the mobile's environment.
    Something I didn't tell: we have 2 servlets in our application, 1 responsible for output in html and 1 in pdf. The .fo stylesheet passed to the 'html servlet' is parsed correctly (and shows the source code, because it does not know about fo and conversion to pdf), the .xsl stylesheet passed to the 'pdf servlet' raises same exception/same line. You might tell us that there is a problem with the 'pdf servlet', but once again: why in online it is working?
    Greetings and thanx very much for your precious time!

  • XSLT : Problem using xsl:value-of disable-output-escaping="yes"

    Hello,
    I have some problem using "disable-output-escaping" attribute of xsl:value-of() function.
    I have a table SONGS with two columns XML and XSL filled with :
    <song>
      <title>Isn't she lovely?</title>
    </song>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <xsl:output method="xml" encoding="UTF-8"></xsl:output>
      <xsl:template match="//song">
        <out>
          <xsl:value-of select="title" disable-output-escaping="yes"></xsl:value-of>
        </out>
      </xsl:template>
    </xsl:stylesheet>The query to transform XML with XSL :
    SELECT XMLTRANSFORM (xml, xsl)  FROM songs;I get this XML :
    <out>Isn&apos;t she lovely?</out>but I want that (without the '&amp;' special character) :
    <out>Isn't she lovely?</out>How can I procees to succeed ?
    Thanks,
    Dominique

    What DB version?
    The following SQL
    select xmltransform(XMLTYPE('<song>
      <title>Isn''t she lovely?</title>
    </song>'), XMLTYPE('<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <xsl:output method="xml" encoding="UTF-8"></xsl:output>
      <xsl:template match="//song">
        <out>
          <xsl:value-of select="title" disable-output-escaping="yes"></xsl:value-of>
        </out>
      </xsl:template>
    </xsl:stylesheet>'))
      from dual;produces this on 11.1.0.6
    <?xml version="1.0" encoding="UTF-8"?>
    <out>Isn't she lovely?</out>and this on 10.2.0.4
    <out>Isn&apos;t she lovely?</out>I found a couple of previous discussions regarding this at
    {thread:id=679397}
    {thread:id=879301}
    The last discussion provides a workaround if you need it.

  • Replacing a value of a node with CDATA (as is)

    Hi All,
    How do I replace the value of a node such that it's CDATA format is preserved and not re-encoded. Currently, when I do similar to the following:
    replace value of node doc(doc_name)/parent/node with "<![CDATA[[the data]]]>"
    the less than and greater than signs are replaced with &lt ; and &gt ; respectively, losing its CDATA section status.
    How do I replace the value such that within the resulting XML it is exactly "<![CDATA[[the data]]]>" and not "&lt ;[CDATA[]the data]]&gt ;" ?
    Thanks in advance
    Cecil
    Edited by: user5969022 on Jan 8, 2009 9:41 PM
    Edited by: user5969022 on Jan 8, 2009 9:42 PM
    Edited by: user5969022 on Jan 8, 2009 9:44 PM
    Edited by: user5969022 on Jan 8, 2009 9:45 PM

    John,
    I am aware that it's synatic sugar. However, I actually need it to look that way. Thing is after edits, the resulting XML will be read by a component (that I have no access to change) which requires that node to have CDATA (as is) as it's value.
    Anymore ideas; Anyone?
    Instead of replacing the value (ie. replace value of node doc()...), I replaced the node (ie. replace node doc()...) with something similar to: <node>CDATA-section</node>. However, as expected only the data within the CDATA section gets persisted.
    In this case could I turn something off or on such that xmldb leaves the CDATA-section as is? e.g. http://www.xquery.com/tips_and_tricks/including_CDATA_in_results.html
    Thanks,
    Cecil

  • Modify a value of a node

    Hi fellow developers
    I�m trying to modify a value of a node.
    But I think I�m missing something. Please help.
    thanks in advance
    for(int i=0;i<List.getLength();i++){
                        node=List.item(i);
                        if(node.getChildNodes().item(0).getFirstChild().getNodeValue().equals(projectNum)){
                             projectNum = node.getChildNodes().item(0).getFirstChild().getNodeValue();
                             node.getFirstChild().setNodeValue("333");

    Without the dtd, it is not clear why the sample code fails but here are a few pointers that may be of use:
    - The j2ee tutorial on java.sun.com:
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXPDOM5.html#wp64575
    has a section on 'examing the structure of a dom' .
    Excerpt for the above URL:
    Note: Important! Text nodes exist under element nodes in a
    DOM, and data is always stored in text nodes. Perhaps the most
    common error in DOM processing is to navigate to an element
    node and expect it to contain the data that is stored in that
    element. Not so! Even the simplest element node has a text
    node under it that contains the data. For example, given
    <size>12</size>, there is an element node (size), and a text
    node under it that contains the actual data (12).
    http://java.sun.com/j2ee/1.4/docs/tutorial/examples/jaxp/dom/samples/DomEcho02.java is a useful program to analyze the structure of a dom.
    - You can try printing the DOM and analyse the structure of DOM. The following URL has a set of useful samples for xml dom processing: http://developers.sun.com/sw/building/codesamples/dom/. In particular the DOMUtils class has two useful static methods for debugging a DOM:
    1. printDOM(org.w3c.dom.Node node): Prints the specified node, then prints all of its children.
    2. writeXmlToFile(java.lang.String filename, org.w3c.dom.Document document): This method writes a DOM document to a file
    http://developers.sun.com/sw/building/codesamples/dom/doc/DOMUtil.java
    - http://forum.java.sun.com/forum.jspa?forumID=34 is the forum for java technology & xml.
    Hope u find the pointers useful.

  • Reading Infoobject value in Report

    Hi,
    I have an infoobject with hierarchy say POBJECT. a variable called HPOBJECT is created so that user is can sleect  the Hierarchy and Node of the Hierarchy.
    Now the task is i need to create an another variable which reads the Hierarchy value of the POBJECT.Normally i_t_var_range in CMOD should contain the value. so that i can read the value based on the HPOBJECT . But the problem here is in different Queries they have used different variables for the object POBJECT like HPOBJECT and QOPBJECT.
    so i have a problem in making a statement like
    READ TABLE i_t_var_range INTO l_var_range WITH KEY vnam = '.HPOBJECT'. As this vnam is not same for all the Queries. so i want to read the value of the POBJECT rather than reading based on the vnam.
    I can also make the statement
    from
    READ TABLE i_t_var_range INTO l_var_range WITH KEY vnam = '.HPOBJECT'.
    to
    READ TABLE i_t_var_range INTO l_var_range WITH KEY IOBJNM = 'POBJECT, but the problem here is POBJECT conatins Hierarchy and also Node.
    Does any body have an idea how this can be achieved?.
    Thanks.
    Praveen.

    Hi
    Is your contr area currency same as comp code currency? If yes, then this difference shall not arise....
    Check for any OSS notes or raise it to SAP if your both currencies are same
    BR,Ajay M

Maybe you are looking for

  • [K8N Neo2 Platinum] BSOD - have had enough of them!

    My first K8N Neo2 was a DAO - no current to the PCI slots. Got a new one as replacement, seemed to work fine. "Seemed", indeed. I've had plenty of sudden resets and BSODs. I've seen: STOP 0x000000FC (no error or driver named) STOP 0x000000EA in ATI2D

  • Webdynpro error in Post installation steps of SLD

    Hi We are working on EP7.0 2004s.We are using local sld.Right now I am doing the post installation steps for SLD.I added the J2EE and UME roles.In the next step I went into the administration tab of SLD for configuring.It is throwing this error. <b>c

  • Anyone using an Ipod in a VW with their "ipod adapter"  help!!

    This is the worst interface I think I've ever seen for an IPOD and I'm wondering if anyone knows if VW has a work-around to improve their interface. Currently, the car stereo treats the Ipod as an external cd changer and will only play the first five

  • Hyperion analytic integration services

    How to add formulas on members of metaoutline in hyperion analytic integration services console? It is throwing up error like "members only with dynamic hierarchy can be added with formulas".How to give a member as dynamic hierarchy in integration se

  • HT201240 change the email account for the mac

    i used the wrong email for my new mac