XSL transformations - choice element

Hi all

Need of entries making transformations xslt on an element of choice. Please provide useful URL/entries.

My (one) xsd: -.

< xs: element name = "Root" >
< xs: complexType >
< xs: Choice minOccurs = "0" maxOccurs = "1" >
< xs: element name = "field1" type = "xs: String" > < / xs: element >
< xs: element name = "Field2" type = "xs: String" > < / xs: element >
< xs: element name = "field3" type = "xs: String" > < / xs: element >
< xs: element name = "field4" type = "xs: String" > < / xs: element >
< / xs: Choice >
< / xs: complexType >

Required output: -.

< root >
message from < Field1 > < / field1 >
< / root >
or
< root >
message from < Field2 > < / Field2 >
< / root >
or
< root >
message from < field3 > < / field3 >
< / root >

But when I do the transformations the output is shown below. How could I get the above entry?

< root >
message from < Field1 > < / field1 >
< Field2 / >
< field3 / >
< field4 / >
< / root >

Please let me know

Hello

You use the "transformation" of the BPEL activity?
If Yes, then you can check two things:
-That the XSL map option generates no empty node for all unmapped nodes
-You have an if condition check if the node exists before mapping.

Kind regards
Mathieu

Tags: Fusion Middleware

Similar Questions

  • Error: "... isn't a table...". "XML is not correctly interpreted after the XSL transformation. Problem of quantity of line table.

    Hey guys, it's one of my xml elements:

    Jaspreet Sohi 12 18 Juliane Lenz 11 17 Sophie Charlotte Stender 10 15 Rosbeh Hamidzadeh Khayyat 12 17 Lion Stoldt 12 17 Poles Lucas Meincke 6 8 Bero Luke Vincent Ernst 6 8 Cedric Roth 6 8 Soner Cantay 6 8 the following XSL Transformation tags I use once to turn all "m" tags and one to transform all 'j '. Please, imagine the CSL-code below to reproduce exactly. Only the 'young' - table - Tag are replaced by "Mädchen" and all BROKEN underscore characters are replace by _m. like all the "select =" j [@...] "." "have been replaced by" select = "m [@...]". " ". 1 2 3 the code is very easy to live I think and not difficult to understand. As I said, I use it twice - for two transformations. The very, very strange thing, my problem is that a transformation works perfectly in InDesign and a table is created for all 'kategorie' - tags (everything is located in a foreach loop). But the second script does not work! Simply, I don't get it I can't understand. I tried more than anything. InDesign ISC (in German, translated so hypothesis based on) 'young is an invalid table element or is displayed in the wrong order. The second strange thing is that I can replace my attribute "aid: trows ' by a number, for example '10' and immediately the script works very well (there are never more than 6 'j'" tags in my XML so that the table is never more than 6 rows "). But it does not work properly with the real number, my variable "rows_j". These are my variables: they are all defined before the tables for m and j are created. So finally, why (the devil) is a table created and performed perfectly while the second - in the aftermath of the first in the XSL.script as a replica of the first - causes an error? As I've already said, I really tried everything. For example, the script also works when one of the parties ' ' is deleted at random by the script. Removing one of these parts directly makes the job of script. One of my attempts to understand the thing, but it only showed that none of these pieces 'cell to end-for-each' there is an error. I'm really desperate and research before being rescued by one of you geniuses :)

    Ah, no worries. The forum software is, well, different.

    What would be better, however, would be an example of ID file, all XSLT/XLT files you use, and one bit of data exactly as you have (State before processing). ZIP upward, upload to say dropbox.com and feel free to send me a private message for the download link.

    Too often there is something different between the pasted samples by post and the real thing it is sometimes less useful LeRiz. I'll keep it private, of course. Then we can communicate via PMs or email until we can find together a solution (hopefully), and then publish that this solution is in the forum for the benefit of others.

    Thank you, Mike

  • Keep the white space from an xsl transformation

    Hi, I really need help on this... I want to be able to use an xml file to put in content and style it in the xsl fragment I can get the xsl transformation to work OK. But! I can't find a way to preserve white space or line breaks. All I get is a continuous paragraph for every words of about 2000 article for each. It looks like hell.

    I tried this element < Preserve-space elements = "ARTICLE" / > is not used in a xsl transformation fragment no chance! and < Preserve-space elements = "*" / >

    Do I need another encoding? I use <? xml version = "1.0" encoding = "UTF-8"? >

    Is there a way I can use html in the xml file? as < br / >

    I know, in Flash, you can specify a return like this \r in the xml file

    Please any help would be appreciated.

    IsleA-Row2_Seat7

    No, I forgot something. A section using CDATA is the right way to store HTML tags in an XML node, but only when using XSLT to output, you must add the disable-output-escaping attribute in the element:

    
    
  • XQuery ora: processXQuery() in XSL transformation

    Can we use Xquery ora: processXQuery() in XSL transformation?

    Thank you
    Vivek





    Query.XQ = the code of the query itself
    bpws:getVariableData('EmployeeTravelStatusRequest','employee') = element root payload of source
    Game EmployeeTravelStatusResponse"="employee"= root target element.

    see you soon
    James

  • CPO XSL transformation to form CPSC with grid data

    Does anyone have a developed XSL transformation that ideally analysis the CPSC release as a link of Service when there a grid in it?

    For example, the CPSC Link Service data might look like:

    An Action

    123

    ...

    Some data

    SomeValue

    SomeOtherValue

    yetanothervalue

    value2

    someothervalue2

    yetanothervalue2

    So the desired output

    SomeValue

    SomeOtherValue

    yetanothervalue

    value2

    someothervalue2

    yetanothervalue2

    I have trouble getting the right select XSL when the tag is something like ' DictionaryWithGrid-#. Field '.

    Thank you!

    Try this...



    "" xmlns: xsl = "http://www.w3.org/1999/XSL/Transform"
    xmlns: msxsl = "" urn: schemas-microsoft-com: XSLT ">"


     


         
           
         

     


       
        
       
       
         
           
             
               
               
                 
               

             

           

         

          
         
           
         

       

        
     

     

  • Help about the XSl transformation

    I have a xml like this

    <? XML version = "1.0"? >

    <? XML-stylesheet type = "text/xsl" href = "st.xsl"? >

    workflows <>

    < completed workflow = "COMPELETED" Name = "CRMODWF6027" >

    < action >

    < completed = 'COMPELETED"Name ="SendMailAction">

    Notification of < type > < / Type >

    < / action >

    < / actions >

    < / workflow >

    < completed workflow = 'INCOMPLETE' Name = "CRMODWF6028" >

    < action >

    < completed = 'COMPELETED"Name ="UpdateValueAction">

    Update < type > values < / Type >

    < / action >

    < completed = 'INCOMPLETE' Name = "WaitAction" >

    Action not supported < type > < / Type >

    not SUPPORTED for < error > < / error >

    < / action >

    < / actions >

    < / workflow >

    < completed workflow = 'INCOMPLETE' Name = "CRMODWF6000" >

    < error > an error has occurred during the recording of the workflow

    C:\temp\Log\ErrorImages\CRMODWF6000_1400655809602.PNG < ErrorFile > < / ErrorFile >

    < / error >

    < / workflow >

    < completed workflow = 'INCOMPLETE' Name = "CRMODWF6022" >

    unsupported AccountAddress < error > record type < / error >

    < / workflow >

    < / workflows >

    I wrote like this transformation

    <? XML version = "1.0" encoding = "UTF-8"? >

    < xsl: stylesheet version = "1.0".

    "xmlns: xsl ="http://www.w3.org/1999/XSL/Transform">".

    < xsl: template match = "/" >

    < html >

    < body >

    File of the workflow log < h2 > < / h2 >

    < table border = "1" >

    < tr bgcolor = "#9acd32" >

    name of the workflow < th > < /th >

    State of the workflow < /th > < th >

    < /th > < th > workflow error

    < /tr >

    < xsl: for-each select = "Workflows/Workflow" >

    < b >

    < td > < xsl: value-of select="@Name"/ > < table >

    < td > < xsl: value-of select="@Completed"/ > < table >

    < td > < xsl: value-of select = "Error" / > < table >

    < table border = "1" >

    < xsl: for-each select = "Actions/Action" >

    < b >

    < td > < xsl: value-of select="@Name"/ > < table >

    < td > < xsl: value-of select="@Completed"/ > < table >

    < td > < xsl: value-of select = "Type" / > < table >

    < td > < xsl: value-of select = "Error" / > < table >

    < /tr >

    < / xsl: foreach >

    < /table >

    < /tr >

    < / xsl: foreach >

    < /table >

    < / body >

    < / html >

    < / xsl: template >

    < / xsl: stylesheet >

    How to turn like that

    OP: level of workflow to

    Name of the workflow
    State of the Workflow
    Workflow error message



    Depending on the status that we can probably do an outstanding CLOTH.

    Red: Status incomplete = with Error Message not as "unsupported %.

    AMBER: Status incomplete = with Error Message like "unsupported %.

    Green: Status = completed

    Down: at the level of the workflow Action

    Name of Worklfow
    Name of the action
    Type of action
    Status of the action
    Incorrect user action





    Here, too, we can do a RAG encoding:

    Green: Status = completed

    AMBER: Status = incomplete and type = Action not supported

    Red: Rest all

    Thank you

    Delphine

    Such a feature is generally known as grouping in xslt 1.0 where often xsl: Key construction is necessary to effectively deal with the problem. In this case, I guess that all of the data is not very big, that we can go out with less efficiently, which could even be more "effective" in a small set of data...

    Moreover, I have to assume error and Actions are not in a kind of competition in the sense that if the error is there Actions would not, and vice versa. This is necessary in the following as construction assumes that there is error 2 and there are Action 4... In this fictional case, whether to rowspan the largest number... and that the distribution of line covering itself could be problematic as: would you rank extended error? etc.

    We clearly, it's a way to do it.

    [code]

    [/ code]

    Note that I have not rowspan error column but only the first two columns. I did the mistake and Action on equal footing... If you really want rowspan error as well, you can put some parolees more share of td involved. But under this idea and if there might be more than one error actually under workflow, we can wonder why not in this case rowspan all the Action... It would be more script and the document looks more like the work of patch!

    PS My editor of xslt is nothing special, just publishing text multi-character-encoding-ready or these ide free everyone.

  • saveXML does not apply to the XSL transformation

    I have a XSL I want to use to fill a 2d barcode. I put the connection of data as follows:

    However, when I call

      this.rawValue = xfa.record.saveXML();
    

    It does not apply the XSL transformation. What should I do to force the transformation? If I do an Acrobat data export operation, the resulting XML file is transformed, so I can't change my work.

    Ok. I think I have a solution. The stylesheet nodes are packages className, so using the code below:

    var oStyleSheets = xfa.resolveNodes("stylesheet[*]")
    for (var i = 0; i < oStyleSheets.length; i++) {
        if (oStyleSheets.item(i).getAttribute("id") == "XFADataInputXSL")
            console.println("got input XSL");
        else if (oStyleSheets.item(i).getAttribute("id") == "XFADataOutputXSL")
            console.println("got output XSL");
    }
    

    I can then pull out the style sheet just for work.

  • optimization of xsl transformations

    I have a .cfm page created in DW8 that consumes 8 remote RSS feed to display the titles of the new updates. I have 8 pages of xslt fragment separated - each containing the xml data for each source of news displayed on the .cfm page. The site in question is zedmediaonline.net. Originally, I had about 20 transformations xsl on the .cfm page, but the page just took too long to load, so I had to reduce the number of xsl transformations.

    My question is: are there at - it somehow opitimize the code to do xsl transformations to load faster? Ideally, I would like to have about 20 transformations xsl on the .cfm page that load at a reasonable speed. IM using Coldfusion MX and DW8.

    Any help or advice in this area is very much appreciated. Thank you.

    To cache the results of transformations on the server for 10 seconds approximately. Otherwise, your XSLT stylesheets may be able to be optimized.

  • Error XSL Transformation

    I created a text version only of my application using XSL Transformation (to respect the mandate 6102) which worked very well on my test server, but when you migrate development server, I get the error the file name, directory name or volume label syntax is incorrect.

    I rebuilt the XSL files and reapplied the XSL Transformation on the development server. I noticed that the value of the component changed 'app.includes.MM_XSLTransform.MM_XSLTransform' to 'http:.includes. "MM_XSLTransform.MM_XSLTransform", but the error identifies the line < cfinvokeargument name = "xsl" value = "... / 0_intro/intro.xsl" > as the problem. "

    Any help is greatly appreciated.

    Let's not the name of your component. Unless you have a directory named "http:", which I doubt (and I'm not even sure that semicolons are valid characters in the paths of access/names of components).

  • Need help with the XSL transformation

    Hi, I have a requirement where a message is received at the service of BPEL. The message is essentially a list of 200 or less ProductID.
    The requirement is to break the message coming into smaller messages with a list of 50 each ProductID, and then according to the number small messages call in parallel a service Proxy in OSB.

    I don't know how to write an XSL transformation that could divide the message into smaller messages.
    I would be very grateful if someone could help or give directions.

    Hello

    Import the settings. XSD in your wsdl in the section file types



    Concerning

    PavanKumar.M

  • using the 'if' condition in a xsl transformation

    Hi all

    I have a requirement in which I need to convert an xml format

    < root >
    < name of employee = "employee1" >
    < salType salary = 'real' TN '10000' = >
    < salType salary = 'virtual' TN '20000' = >
    < salType salary = 'real' TN '30000' = >
    < salType salary = 'virtual' TN '40000' = >
    < salType salary = 'virtual' TN '50000' = >
    < / employee >
    < name of employee = "employee2" >
    < salType salary = 'virtual' TN '10000' = >
    < salType salary = 'virtual' TN '20000' = >
    < salType salary = 'real' TN '30000' = >
    < salType salary = 'real' TN '40000' = >
    < salType salary = 'virtual' TN '50000' = >
    < / employee >
    < / root >


    in the XML of the following form

    < root >
    < employee >
    employee1 < name > < / name >
    < annualSalary > 40000 < / annualSalary >
    < / employee >
    < employee >
    < name > employee2 < / name >
    < > 70000 annualSalary < / annualSalary >
    < / employee >
    < / root >

    where "annualSalary' in the output xml file is the sum of"amt"in the xml input file where"salType"="Actiual.
    Thus, for employee1 'annualSalary' = 10000 + 30000 and for employee2 'annualSalary' = 30000 + 40000

    I finished the transformation to map the name of the employee and the annualSalary (sum of all the "amt" in input xml regardless of real or virtual in "salType").

    But how can I filter only 'real' salType and the sum of their "amt" using xsl transformation

    Thank you
    Pavan

    Pavan,

    Sorry yaar, I typed it correctly, dono whats wrong it should be like this


    **

    Sen

    Published by: Sen2008 on July 15, 2009 02:46

    Published by: Sen2008 on July 15, 2009 02:47

  • XSL Transform map failure during execution due to missing element Xpath

    Hello

    I have a case where I use a source variable which has two components. At run time, these variables can be non-existent depends on previous activities.

    The problem is the transformation XSL doesn't like it and fails with the error

    XPath expression cannot run.

    The XPath expression cannot run; the reason was: oracle.xml.parser.v2.XMLDOMException: import not allowed on nodes of type of document.

    Check the detailed origin described in the text of the exception message and verify that the XPath query is correct.

    How can I ignore for the mapping of similar transformation to affect ignoreMissingFromData activity?

    Thank you.

    Hello

    > variable source that has two components. At run time, these variables can be non-existent

    Are you talking about BPEL variables or XML elements? Can send you a sample xml?

    In any case, I think you could use getContentAsString or something like that in your XLST and causing its failure... A workaround is to use xslt:if or xslt: choose test if the element is there...

    See you soon,.

    Vlad

  • XSL transformation - distinct values

    Hello

    I have a XML code that is needed using XSL, I think that this can be done using distinct values, however, I have no luck in getting this work. Could someone guide me on what function use. Any guidance / help is greatly appreciated.

    Here is the XML source, this scenario is that there are two different products, delivered in a box
    <p:Items>
        <p:Item ItemID="12">
          <p:ProductID>123456</p:ProductID>
          <p:Quantity>1</p:Quantity>
          <p:NetPrice>12</p:NetPrice>     
          <p:Packages>
            *<p:Package BoxID="1">*
              <p:Quantity>1</p:Quantity>
              *<p:TrackingNumber>12345678910111213</p:TrackingNumber>*
            </p:Package>
          </p:Packages>
        </p:Item>
         <p:Item ItemID="12">
          <p:ProductID>1400</p:ProductID>
          <p:Quantity>1</p:Quantity>      
          <p:NetPrice>10</p:NetPrice>      
          <p:Packages>
            *<p:Package BoxID="1">*
              <p:Quantity>1</p:Quantity>
              *<p:TrackingNumber>12345678910111213</p:TrackingNumber>*
            </p:Package>
          </p:Packages>
        </p:Item>     
     </p:Items>
    The XML has to be converted to,
     <ns2:package_Data>
                *<tns:package_id>1</tns:package_id>*
                <tns:package_Items>
                   <tns:vendor_item_number>123456</tns:vendor_item_number>
                   <tns:quantity_shipped>1</tns:quantity_shipped>
                </tns:package_Items>
                   <tns:package_Items>
                   <tns:vendor_item_number>1400</tns:vendor_item_number>
                   <tns:quantity_shipped>1</tns:quantity_shipped>
                </tns:package_Items>
                *<tns:trackingNumber>12345678910111213</tns:trackingNumber>*
    </ns2:package_Data>
    If two different products is shipped in 2 different boxes, which will have two box ID and Tracking # the source XML would look like this.
    <p:Items>
        <p:Item ItemID="12">
          <p:ProductID>123456</p:ProductID>
          <p:Quantity>1</p:Quantity>
          <p:NetPrice>12</p:NetPrice>     
          <p:Packages>
            *<p:Package BoxID="1">*
              <p:Quantity>1</p:Quantity>
              <p:TrackingNumber>12345678910111214</p:TrackingNumber>
            </p:Package>
          </p:Packages>
        </p:Item>
         <p:Item ItemID="12">
          <p:ProductID>1400</p:ProductID>
          <p:Quantity>1</p:Quantity>      
          <p:NetPrice>10</p:NetPrice>      
          <p:Packages>
            *<p:Package BoxID="2">*
              <p:Quantity>1</p:Quantity>
              <p:TrackingNumber>12345678910111215</p:TrackingNumber>
            </p:Package>
          </p:Packages>
        </p:Item>     
     </p:Items>
    The transformed XML should look like this,
     <ns2:package_Data>
                *<tns:package_id>1</tns:package_id>*
                <tns:package_Items>
                   <tns:vendor_item_number>123456</tns:vendor_item_number>
                   <tns:quantity_shipped>1</tns:quantity_shipped>
                </tns:package_Items>
                *<tns:trackingNumber>12345678910111214</tns:trackingNumber>*
    </ns2:package_Data>
    <ns2:package_Data>
                *<tns:package_id>2</tns:package_id>*
                <tns:package_Items>
                   <tns:vendor_item_number>1400</tns:vendor_item_number>
                   <tns:quantity_shipped>1</tns:quantity_shipped>
                </tns:package_Items>
                *<tns:trackingNumber>12345678910111215</tns:trackingNumber>*
    </ns2:package_Data>
    Here is the XSL code, I tried to use different values in the for-each leading to the error, the code below works fine for the second scenario mentioned above.
     <xsl:for-each select="/ns0:OrderStatus/ns0:Items/ns0:Item/ns0:Packages/ns0:Package">
                <ns2:package_Data>
                  <tns:package_id>
                    <xsl:value-of select="@BoxID"/>
                  </tns:package_id>
                  <tns:package_Items>
                    <tns:vendor_item_number>
                      <xsl:value-of select="../../ns0:ProductID"/>
                    </tns:vendor_item_number>
                    <tns:quantity_shipped>
                      <xsl:value-of select="../../ns0:Quantity"/>
                    </tns:quantity_shipped>
                  </tns:package_Items>
                  <tns:trackingNumber>
                    <xsl:value-of select="ns0:TrackingNumber"/>
                  </tns:trackingNumber>
                </ns2:package_Data>
              </xsl:for-each>
    Thank you
    Fri

    Try something like this...

    
    
      
      
          
             
          
          
             
                 
                     
                 
    

    See you soon,.
    Vlad

  • Problems with the function document XSL Transformation on OSB

    I'm trying to use the xsl document feature in my XSLT file to perform a transformation on the Bus of Service Oracle (version 11.1.1.4), but I see the following error message when you run the sbconsole test (just to test the transformation currently).

    Execution of the XSLT error: com.sun.org.apache.xalan.internal.xsltc.TransletException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: Validation of XSLT Project1/xslt/iso-3-to-iso-2-lookup.xml: XSLT Project1/xslt/iso-3-to-iso-2-lookup.xml does not exist has failed

    The error indicates the file XML I'm referencing from the XSLT that does not exist in the specified folder, I confirmed that the file exists and we tried to move to other places and chaning the location of reference in the XSLT, but the error persists (with location of update). Anyone know if the XSL document function is supported for the transformations on the OSB or if there is something special that needs to be done so that the OSB can refer to the XML file properly?

    Here is the code snippet of the xslt file that launches a call using the XML file:
    ...
    < xsl: output method = "xml" encoding = "UTF-8" Indent = "Yes" omit-xml-declaration = "yes" / >
    "< xsl: Key name="ISO-3-to-ISO-2-lookup ' match = 'country' use = "iso3" / >
    "< xsl: variable name="ISO-3-to-ISO-2-Lookup "select ="document('iso-3-to-iso-2-lookup.xml')/ISO-pays"/ >
    < xsl: template match = "/ xx - xxxx:SyncSearchRequest" >
    < ns0:Search >
    ...

    Here is an extract from the XML file that I use as the lookup table:
    ...
    ? XML version = "1.0"? >
    < ISO-country >
    AF < country > < iso2 > < / iso2 > < AFG iso3 > < / iso3 > < / country >
    < country > < iso2 > AX < / iso2 > < ALA iso3 > < / iso3 > < / country >
    < country > < iso2 > AL < / iso2 > < ALB iso3 > < / iso3 > < / country >
    ...

    Thanks for any help.

    In OSB, document() function needs the path absolute XML file. So if you want to access the XML document for the search, you should place the XML file on the server itself and use the path of the XML file.

    Although it is not a good approach for the management of the OSB research. The type of Document XML resource must not be used for these use cases. What you can do is create an XQuery query that can server as a DVM.
    Here is an example on how to use DVMs in OSB:
    https://blogs.Oracle.com/christomkins/entry/domain_value_maps_in_oracle_se

    If you do not want to use XQuery and want to rely only on XSLT, then in the same document XSLT to create a separate model that can store all the data of research.

  • A Choice element and option «More...» ».

    Hello! I have SelectOneChoice element in my form, see: http://my.jetscreenshot.com/2677/20120328-6dub-11kb

    As you can see in the photo. There are more '... "option. I want to know, how to remove it?

    Best regards, Debuger!

    So the 3. option is actually the right thing to do. If you got rid of the empty items in the list can stay with this solution.

Maybe you are looking for