Xml result fragment to node-set

I wrote a stylesheet that transforms data into a html table and dedupes all consecutive identical elements.
The consecutive duplicates obviously depend on the sorting of the data, which is also a variable of the stylesheet.
I ended up using the msxml:node-set function that allowed me to convert a sorted result fragment (in a variable) back into a node-set. Is there anything equivalent in oracle's parser? or a workarround to pre-sort the data?
I would like to avoid multi-step transforms if possible...
thanks for any help.
null

never mind... found ora:node-set()
must have been blind I guess....
null

Similar Messages

  • Using msxsl:node-set as a function to a field in InfoPath 2010

    I have been trying to query a node set (from a web service - managed metadata web service infact) without success.  I received a GetTermSetsResult that I am trying to parse as an xml using msxsl:node-set().    Currently I am just throwing
    up messages about the expression result in a form load rule.   I just get empty node sets.  Note that I have even tried querying the xml string directly like in the examples below but the behavior is always the same.
    some examples of what I have tried that give empty nodesets:
     msxsl:node-set('<Container><TermStore>...'))/Container/TermStore
     msxsl:node-set('<Container><TermStore>...'))/Container
     msxsl:node-set('<Container><TermStore>...'))/*
    These give the following results:
     count(msxsl:node-set('<Container><TermStore>...')))  ---> reports "1"
    count(msxsl:node-set('<test>...</test><test>...</test>')))  ---> reports "1" when it should say "2"
    msxsl:node-set('<Container><TermStore>...'))/node()   ---> returns what looks like the entire xml document
    Ultimately I want to populate a listbox with managed metadata (taxonomy/folksonomy) terms in a "codeless" way.  I know it is a no brainer to use code behind but where I work they like to see minimum code.

    Hello mohrr,
    The PCIe-6321 doesn't have internal triggers you you have to export the signals to a PFI line ant the use the signal as external trigger.
    If you are not very familiar about how to do that, here you can find two documents that can give you an idea about how does it work.
    http://digital.ni.com/public.nsf/allkb/A099C37789A​ACEE386256E35007338E6?OpenDocument
    http://digital.ni.com/public.nsf/allkb/3A7F1402B2A​1CE7686256E93007E66C0?OpenDocument
    Mr.O
    Applications Engineer
    National Instruments

  • Casting a result-tree-fragment into a node set

    Hi,
    Is there anything in BI Publisher that converts a result-tree-fragment into a node set, which resembles the node-set function in as in the following link? http://www.exslt.org/exsl/functions/node-set/
    Thanks,
    Jonathan

    Hi,
    Seems no one understands my need in my post yet. Let me elaborate my requirement a little more...
    Actually in my case, I used a variable to refer to a node set (in my actual implementation the conditions in the bracket [] are much much more complicated ), e.g.
    <?variable:rows;”/ROWSET/ROW[SALARY>1000]”?>
    And since the report involves a complex layout printed on pre-print forms which needs me to put the fields very precisely. I cannot use the For Each method but to extract the rows one by one, likes the following:
    <?$rows[1]/ENAME?>
    <?$rows[2]/ENAME?>
    and put them on various position on the RTF Template.
    So far so good, until I realized that the $rows node set is needed to be sorted according to ENAME.
    Currently I can build a sorted list from $rows into another variable $sorted_rows as follows:
    <xsl:variable name="sorted_rows"><xsl:for-each select="$rows"><xsl:sort select="ENAME"/><xsl:copy-of select="."/></xsl:for-each></xsl:variable>
    But in $sorted_rows, it contains only one item which is the xml fragment of the sorted data, but not a node set.
    So my question is, is there any way to convert this xml fragment into a node set so I can use the following to extract the fields?
    <?$sorted_rows[1]/ENAME?>
    <?$sorted_rows[2]/ENAME?>
    Hope anyone can share with my some solution to this.
    Thanks in advance,
    Jonathan

  • How to return two XML result sets using the function

    Hi Experts,
    Thanks.

    So that I want to return two XML result sets if the query returns more than 50,000 records.
    One XML result set with 50,000 and another XML result set with remaining records.
    How to incorporate this in my function.
    Have the function return a collection of CLOB then.
    DBMS_XMLGEN can handle pagination so it's easy to adapt your existing code.
    Here's an example fetching data in batches of max. 3 rows each, using a pipelined function :
    SQL> create or replace type clob_array is table of clob;
      2  /
    Type created
    SQL>
    SQL> create or replace function genXmlRowset (p_deptno in number) return clob_array pipelined
      2  is
      3    ctx    dbms_xmlgen.ctxHandle;
      4    doc    clob;
      5  begin
      6 
      7    ctx := dbms_xmlgen.newContext('SELECT empno, ename FROM scott.emp WHERE deptno = :1');
      8    dbms_xmlgen.setBindValue(ctx, '1', p_deptno);
      9    dbms_xmlgen.setMaxRows(ctx, 3);
    10 
    11    loop
    12 
    13      doc := dbms_xmlgen.getXML(ctx);
    14      exit when dbms_xmlgen.getNumRowsProcessed(ctx) = 0;
    15      pipe row (doc);
    16 
    17    end loop;
    18 
    19    dbms_xmlgen.closeContext(ctx);
    20 
    21    return;
    22 
    23  end;
    24  /
    Function created
    SQL> set long 5000
    SQL> select * from table(genXmlRowset(30));
    COLUMN_VALUE
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
      <EMPNO>7499</EMPNO>
      <ENAME>ALLEN</ENAME>
    </ROW>
    <ROW>
      <EMPNO>7521</EMPNO>
      <ENAME>WARD</ENAME>
    </ROW>
    <ROW>
      <EMPNO>7654</EMPNO>
      <ENAME>MARTIN</ENAME>
    </ROW>
    </ROWSET>
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
      <EMPNO>7698</EMPNO>
      <ENAME>BLAKE</ENAME>
    </ROW>
    <ROW>
      <EMPNO>7844</EMPNO>
      <ENAME>TURNER</ENAME>
    </ROW>
    <ROW>
      <EMPNO>7900</EMPNO>
      <ENAME>JAMES</ENAME>
    </ROW>
    </ROWSET>
    SQL>
    (and don't forget to use bind variables in your query)

  • Include Column type in XML result set

    Hi
    I'm trying to get result of my query as XML but how I can specify columns data type in xml attributes?
    This is my query:
    SELECT * FROM Acc.GL FOR XML AUTO, ELEMENTS, TYPE, BINARY BASE64;
    Unfortunately in XML result, column types are not specified:
    <row>
    <Id>23</Id>
    <GLCode>1</GLCode>
    <BranchRef>1</BranchRef>
    <Title>Foo Title</Title>
    <Balance>1</Balance>
    </row>
    <row>
    <Id>24</Id>
    <GLCode>2</GLCode>
    <BranchRef>1</BranchRef>
    <Title>Bar Title</Title>
    <Balance>1</Balance>
    </row>
    What I expect is something like this:
    <row>
    <Id type="int">23</Id>
    <GLCode type="int">1</GLCode>
    <BranchRef type="int">1</BranchRef>
    <Title type="nvarchar">Foo Title</Title>
    <Balance type="int">1</Balance>
    </row>
    <row>
    <Id type="int">24</Id>
    <GLCode type="int">2</GLCode>
    <BranchRef type="int">1</BranchRef>
    <Title type="nvarchar">Bar Title</Title>
    <Balance type="int">1</Balance>
    </row>
    What should I change in my query?
    Jalalx

    how I can specify columns data type in xml attributes?
    Hello,
    XML Format don't allow to specify the data types in this way, you have to create XSD = "Schema Definition" instead, here are the data types defined.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Document() not returning a useable node set?

    If I open another document during a transform, I can dump out the file using
    xsl:message, but can't match any tags in the loaded file. If I replace the Sun
    implementation with the apache implementation of xalan with -Xbootclasspath/p,
    the code runs fine.
    Example fragment:
    <xsl:variable name="user_type">
    <xsl:for-each select="//include/@file_name">
    <xsl:variable name="xmlFile">
    <xsl:value-of select="$xml_dir"/>/<xsl:value-of select="."/>
    </xsl:variable>
    <xsl:for-each select="document($xmlFile)" >
    <xsl:value-of select="key('type_def_key',$datatype)//datatype" />
    </xsl:for-each>
    </xsl:for-each>
    </xsl:variable>
    <xsl:message>
    User type <xsl:value-of select="$user_type" /> for <xsl:value-of select="$datatype" />
    </xsl:message>
    I believe the problem is with the document function not returning a useable
    node set , or all of the matches are going back to the original document rather
    than the one that was just open. With in the context of the new document
    select="." appears to work, but nothing else seems to.
    Output using Sun's xml implementation (JDK 5.0, 6.0 snapshot)
    User type for Gms_User_Id
    Output using the Apache xml implmentation (Xalan 2.6)
    User type numeric for Gms_User_Id
    The code and xml files are the same in both cases, just changed the runtime
    class path with

    This is behaving as designed.
    Configuring a view object so expect certain entity subtypes does not automatically restrict the rows it queries. If the view object's query returns any row that has a discriminator value that does not match the design-time configured entity subtypes expected, it is not added to the result rowset.
    If you have limited the number of fetched rows to 1, and if that row had a discriminator attribute value that does not match that/those of the expected entity subtypes, then the single row returned by the query will not be added to the result rowset. The result is that the row set has zero rows in it.

  • Converting xmlstring into a node-set

    Hi,
    Is there any xsl function which could take an xml string and convert into a node-set?
    Or could any function be written to achieve this kind of result?
    Thanks.

    Hi,
    Seems no one understands my need in my post yet. Let me elaborate my requirement a little more...
    Actually in my case, I used a variable to refer to a node set (in my actual implementation the conditions in the bracket [] are much much more complicated ), e.g.
    <?variable:rows;”/ROWSET/ROW[SALARY>1000]”?>
    And since the report involves a complex layout printed on pre-print forms which needs me to put the fields very precisely. I cannot use the For Each method but to extract the rows one by one, likes the following:
    <?$rows[1]/ENAME?>
    <?$rows[2]/ENAME?>
    and put them on various position on the RTF Template.
    So far so good, until I realized that the $rows node set is needed to be sorted according to ENAME.
    Currently I can build a sorted list from $rows into another variable $sorted_rows as follows:
    <xsl:variable name="sorted_rows"><xsl:for-each select="$rows"><xsl:sort select="ENAME"/><xsl:copy-of select="."/></xsl:for-each></xsl:variable>
    But in $sorted_rows, it contains only one item which is the xml fragment of the sorted data, but not a node set.
    So my question is, is there any way to convert this xml fragment into a node set so I can use the following to extract the fields?
    <?$sorted_rows[1]/ENAME?>
    <?$sorted_rows[2]/ENAME?>
    Hope anyone can share with my some solution to this.
    Thanks in advance,
    Jonathan

  • How to store xml data fragments, that will not be queried?

    Hello,
    Delphi Client application communicates with Java Server application via XML messages. Client sends XML message over HTTP Post method. Java Servlet gets XML message, parses it, performs requested action (select/insert/update/delete), generates resulting response and sends it back to the Client.
    I use Oracle DB XE 10.2.
    For example: Client sends a request to the server, to append certain Order with new Product info:
    Request:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <Request OrderID="123123123" Action="NewProduct">
    - <Product TempProdID="2" ProdName="L01" VisualID="1" Amount="1" TechClass="1" TechSubject="1" TechVersion="0" TechName="TestTech" ElemOk="0">
    <Modified UserID="XXX" UserGroup="XXX" GroupLevel="0" />
    - <QuickInfo>
    <ProdIcon Format="PNG"
    Encoding="Base64">iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAA
    lC+aJAAAAA3RSTlP////6yOLMAAAAvElEQVR42u3aQQ6EIAwAQP7/afe0
    mo1mBVur0emJgwGmRDFNWwvH9I153OpjyoisefqXW3afm4WypP+MgomvT
    z8AAAAAAAAAAAAAAMAzAClzAWQAdvexfqATEKmA/Fm0rYs5ozvoAWyWj4
    ZqJ9efQKR8BJAHOPEdKAAc/lLdAhC/K68EBG+JWwAixfABgF8Jf6MAAAA
    AAAAAAAAAAAAALwRUGgAAAAAAsgGJ3cfVrcfFl2jiIZzV+V7Zd/8BOtNi
    0MnJ58oAAAAASUVORK5CYII=
    </ProdIcon>
    <Parameters />
    </QuickInfo>
    - <TechProduct CurVer="1" MinVer="1" TotalItems="330" ItemNodeSize="55074">
    - <SubItem Class="TPlGraph" BindID="00B9C004">
    <PropList />
    - <SubItem Ident="Profiles" Class="TProfileList" Child="1" BindID="0188598C">
    <PropList />
    - <SubItem Class="TPlProfile" Child="1" BindID="018CA6CC">
    - <PropList>
    <Property PropIdent="ProfBaze0X" ValText="0" />
    <Property PropIdent="ProfBaze0Y" ValText="990" />
    <Property PropIdent="ProfBaze1X" ValText="990" />
    <Property PropIdent="ProfHier0" ValText="0" />
    - <Property PropIdent="InBorder" ValIdent="None" ValText="N&#279;ra">
    <ExtValue ColIdent="ItemCode" Value="None" />
    <ExtValue ColIdent="Type" Value="" />
    <ExtValue ColIdent="Filter" Value="" />
    <ExtValue ColIdent="Width" Value="0" />
    <ExtValue ColIdent="TechCall" Value="" />
    </Property>
    </PropList>
    </SubItem>
    </SubItem>
    </SubItem>
    </TechProduct>
    </Product>
    </Request>
    I use DOM parsers to parse the received requests, extract certain info and insert it into relational tables using standart SQL queries.
    My question is: what is the best way to store XML data fragments, that are not required to be saved relationally? I need to save the content of node <TechProduct> from the above example to relational table's column. There will be no need to query this column, no need to use relational views. I will use it only when Client application will request to modify certain order's product. Then I will have to send back the same <TechProduct> node via XML response.
    So what column type do I have to use? CLOB? XMLType? Is it better to use object types? Do I have to register XML Schema for better performance? The size of the fragment can be ~2MB.
    Thanks for your help
    Message was edited by:
    Kichas

    Thank you for reply,
    As you suggested, I will use XMLType storage as CLOB (without XML Schema).
    As I mentioned before, I use Java Servlet, deployed on Tomcat WebServer, to receive XML messages from Client application via HTTP POST method.
    I use these libs to get the XML payload and parse it into a Document:
    import org.w3c.dom.*;
    import org.xml.sax.InputSource;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.DocumentBuilder;
    And here is the code:
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    try {
    // get the XML payload and parse it into a Document
    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
    Document dom;
    InputSource input = new InputSource(request.getInputStream());
    dom = docBuilder.parse(input);
    catch(Exception ex) {
    System.out.println("Exception thrown in XmlService");
    ex.printStackTrace();
    throw new ServletException(ex);
    I create a relational table, that contains XMLType column:
    CREATE TABLE xwarehouses (
    warehouse_id NUMBER,
    warehouse_spec XMLTYPE)
    XMLTYPE warehouse_spec STORE AS CLOB;
    Now I want to insert all DOM Document into XMLType column. So I do like this:
    import oracle.xdb.XMLType;
    String SQLTEXT = "INSERT INTO XWAREHOUSES (WAREHOUSE_ID, WAREHOUSE_SPEC) VALUES (?, ?)";
    XMLType xml = XMLType.createXML(con,dom);
    PreparedStatement sqlStatement = con.prepareStatement(SQLTEXT);
    sqlStatement.setInt(1,2);
    sqlStatement.setObject(2,xml);
    sqlStatement.execute();
    sqlStatement.close();
    dom is the Document, that I got from HTTP Request input stream.
    My servlet throws an exception:
    java.lang.NoClassDefFoundError: oracle/xml/parser/v2/XMLParseException
    at XmlService.GetMatListServiceHandler.processRequest(GetMatListServiceHandler.java:111)
    at XmlService.XmlServiceHandler.handleRequest(XmlServiceHandler.java:43)
    at XmlService.XmlServiceServlet.doPost(XmlServiceServlet.java:69)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:716)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
    why does he needs oracle.xml.parser.v2.XMLParseException? I don't use Oracle parser? Does this code line throws the exception (I am not able to debug my code, because I have not configured JDeveloper to be able to use Remote Debuging):
    XMLType xml = XMLType.createXML(con,dom);
    Does it reparses the given dom Document or what?. When I deploy xmlparserv2.jar to Tomcat, everything is ok, application inserts XML data into XMLType column.
    Is there another way to insert the whole org.w3c.dom Document or Document fragment (that is already parsed) into XMLType column. Can you provide any sample code?
    The Document may contain national symbols, so they should be correctly stored and then later retrieved.
    Many thanks.

  • SSMS 2012:FOR XML PATH Using XPath Node Tests-Columnn name 'test()' contains an invalid XML identifier as required by FOR XML?

    Hi all,
    I am learning XPATH and XQUERY from the Book "Pro T-SQL 2008 Programmer's Guide" written by Michael Coles, (published by apress). I copied the Code Listing 12-8 FOR XML PATH Using XPath Node Tests (listed below) and executed it in my
    SQL Server 2012 Management Studio:
    --Coles12_8.sql // saved in C:/Documemnts/SQL Server Management Studio
    -- Coles Listing 12-8 FOR XML PATH Using XPATH Node Tests
    -- Retrieving Name and E-mail Addresses with FOR XML PATH in AdvantureWorks
    -- 16 March 2015 0935 AM
    USE AdventureWorks;
    GO
    SELECT
    p.NameStyle AS "processing-instruction(nameStyle)",
    p.BusinessEntityID AS "Person/@ID",
    p.ModifiedDate AS "comment()",
    pp.PhoneNumber AS "test()",
    FirstName AS "Person/Name/First",
    MiddleName AS "Person/Name/Middle",
    LastName AS "Person/Name/Last",
    EmailAddress AS "Person/Email"
    FROM Person.Person p
    INNER JOIN Person.EmailAddress e
    ON p.BusinessEntityID = e.BusinessEntityID
    INNER JOIN Person.PersonPhone pp
    ON p.BusinessEntityID = pp.BusinessEntityID
    FOR XML PATH;
    I got the following error message:
    Msg 6850, Level 16, State 1, Line 2
    Column name 'test()' contains an invalid XML identifier as required by FOR XML; '('(0x0028) is the first character at fault.
    I have no ideas why I got this error message.  Please kindly help and advise me how to resolve this error.
    Thanks in advance,  Scott Chang

    Hi Michelle, Thanks for your nice response.
    I corrected the mistake and executed the revised code. It worked nicely.
    I just have one question to ask you about the appearance of the xml output of my Co;les12_8.sql:
    <row>
    <?nameStyle 0?>
    <Person ID="1" />
    <!--2003-02-08T00:00:00-->697-555-0142<Person><Name><First>Ken</First><Middle>J</Middle><Last>Sánchez</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="2" />
    <!--2002-02-24T00:00:00-->819-555-0175<Person><Name><First>Terri</First><Middle>Lee</Middle><Last>Duffy</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="3" />
    <!--2001-12-05T00:00:00-->212-555-0187<Person><Name><First>Roberto</First><Last>Tamburello</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="4" />
    <!--2001-12-29T00:00:00-->612-555-0100<Person><Name><First>Rob</First><Last>Walters</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="5" />
    <!--2002-01-30T00:00:00-->849-555-0139<Person><Name><First>Gail</First><Middle>A</Middle><Last>Erickson</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="6" />
    <!--2002-02-17T00:00:00-->122-555-0189<Person><Name><First>Jossef</First><Middle>H</Middle><Last>Goldberg</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="7" />
    <!--2003-03-05T00:00:00-->181-555-0156<Person><Name><First>Dylan</First><Middle>A</Middle><Last>Miller</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="8" />
    <!--2003-01-23T00:00:00-->815-555-0138<Person><Name><First>Diane</First><Middle>L</Middle><Last>Margheim</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="9" />
    <!--2003-02-10T00:00:00-->185-555-0186<Person><Name><First>Gigi</First><Middle>N</Middle><Last>Matthew</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="10" />
    <!--2003-05-28T00:00:00-->330-555-2568<Person><Name><First>Michael</First><Last>Raheem</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    <?nameStyle 0?>
    <Person ID="11" />
    <!--2004-12-29T00:00:00-->719-555-0181<Person><Name><First>Ovidiu</First><Middle>V</Middle><Last>Cracium</Last></Name><Email>[email protected]</Email></Person></row>
    <row>
    I feel this xml output is not like the regular xml output.  Do you know why it is diffrent from the regular xml xml output?  Please comment on this matter.
    Thanks,
    Scott Chang
    What do you mean by regular xml document? Are you referring to fact that its missing a root element? if yes it can be added as below
    USE AdventureWorks;
    GO
    SELECT
    p.NameStyle AS "processing-instruction(nameStyle)",
    p.BusinessEntityID AS "Person/@ID",
    p.ModifiedDate AS "comment()",
    pp.PhoneNumber AS "text()",
    FirstName AS "Person/Name/First",
    MiddleName AS "Person/Name/Middle",
    LastName AS "Person/Name/Last",
    EmailAddress AS "Person/Email"
    FROM Person.Person p
    INNER JOIN Person.EmailAddress e
    ON p.BusinessEntityID = e.BusinessEntityID
    INNER JOIN Person.PersonPhone pp
    ON p.BusinessEntityID = pp.BusinessEntityID
    FOR XML PATH('ElementName'),ROOT('RootName');
    replace ElementName and RootName with whatever name you need to set for element as well as the root element
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Xslt error: the expression does not evaluate to a node-set

    hi guys - i'm really down because i cannot find / understand my xsl error and i have to finish my work very very soon
    the error message (by using xalan to create from the xml file my html output) is the following:
    xslt error: the expression does not evaluate to a node-set
    and the code fragement is:
    <xsl:template name="getNext">
    <xsl:param name="currentKnoten" />
    <xsl:for-each select="$currentKnoten"> //error is in this line
    </xsl:for-each>
    </xsl:template>please... help me....

    ok thanks!!! this saved me some time ;-)
    now i go back to the origin problem... my main idea is the following xsl code... may u can see here the problem with the node site.. but i think u need the xml file or?
    however this is my relevant xsl code:
    <xsl:template match="DATA">
              <xsl:element name="process">
                   <xsl:attribute name="name">
                        <xsl:value-of select="@name" />
                   </xsl:attribute>
                   <xsl:apply-templates select="INSTANCE"/>
              </xsl:element>
         </xsl:template>
    <xsl:template match="INSTANCE[@class='Data']">
              <xsl:element name="node">
                   <xsl:attribute name="name">
                        <xsl:value-of select="@name" />
                   </xsl:attribute>
                   <xsl:attribute name="class">
                        <xsl:value-of select="@class" />
                   </xsl:attribute>
                   <xsl:call-template name="copyAttributes" />
                   <xsl:variable name="nextNodes">
                        <xsl:value-of select="key('keyGetData', key('keyFrom', @name)/../TO/@instance)" />
                   </xsl:variable>
                   <xsl:call-template name="getNext">
                        <xsl:with-param name="currentNode" select="$nextNodes" />
                   </xsl:call-template>
              </xsl:element>
    </xsl:template>     
    <xsl:template name="getNext">
              <xsl:param name="currentNode"/>
              <xsl:for-each select="$currentNode">
                   <xsl:element name="node">
                        <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
                        <xsl:attribute name="class"><xsl:value-of select="@class"/></xsl:attribute>
                        <xsl:variable name="nextNodes">
                             <xsl:value-of select="key('keyGetData', key('keyFrom', @name)/../TO/@instance)"/>
                        </xsl:variable>
                        <xsl:call-template name="copyAttributes"/>
                        <xsl:call-template name="getNext">
                             <xsl:with-param name="currentNode" select="$nextNodes"/>
                        </xsl:call-template>
                   </xsl:element>
              </xsl:for-each>
         </xsl:template>
         <xsl:template name="copyAttributes">
              <xsl:for-each select="descendant::*">
                   <xsl:copy>
                        <xsl:copy-of select="@*|node()"/>
                   </xsl:copy>
              </xsl:for-each>
         </xsl:template>
         <xsl:template match="@*|node()">
              <xsl:apply-templates/>
         </xsl:template>

  • Best way to save XML results to a file via command line

    I'm trying to set up an easy way that I can save my XML results to a file via the command prompt.
    Here's my current command line statement
    sqlcmd -S server/database -E -i C:\XML.sql -o C:\Test.xml -h -1 -m 1 -y0
    That works about 95% of the way. The problem is it still inserts a couple random line breaks and throws my whole XML off.
    The whole idea of doing this via the command line is because it would be nice to link it to a batch file that runs every so often. Is there a better way to execute a SQL statement and have its contents saved properly to an XML file?

    If I copy and paste the result via SSMS into a file and save it as an XML, I can view it properly in browsers. If I use the code above, I get among other errors: 
    This page contains the following errors:
    error on line 2 at column 202: Encoding error
    The XML file gets processed in a 3rd party app. The file that I paste directly works fine, but the file that the script produces generates errors and it won't work.

  • Document(object, node-set)

    Using xsql 1.0.4.1, I'm having some trouble using the document(object, node-set) function defined in the XSLT 1.0 recommendation, sect 12.1:
    http://www.w3.org/TR/xslt#function-document
    I have a tag in my source xml document which contains a reference to another xml document. I want to construct an XPath expression for this other xml document. The path to the other xml document is specified relative to the source document.
    I'm doing something like this:
    Source Document:
    <blah>
    <some-tag redirect="answer.xml" />
    </blah>XSL:
    <xsl:template match="blah/some-tag">
    <xsl:variable name="redir" select="document(@redirect, / )" />
    <xsl:apply-templates select="$redir//somepath" />
    </xsl:template>
    ...However, Oracle XSLT always comes back with the following error:
    XSL-1013: Error in expression 'document(@redirect, / )'.I also get this error if I try
    document(@redirect, document(''))which is given as an example on pg 446 of Steve's book (but not what I want, since it resolves relative to the stylesheet).
    document(@redirect)works fine, but again is not what I want.
    Am I doing something wrong?
    Brian

    This is Oracle Bug# 1722555, hopefully which will be fixed in the 9.0.1.0.0 release. Currently the two-argument version of the document() function is not recognized properly.

  • Threadinar10 - Page Separator, Page Fragment Box , Tab Set & Tab Components

    Hi All,
    This is the tenth in the Threadinar series. See the Components Threadinar Index at http://forum.sun.com/jive/thread.jspa?threadID=103424 for the complete list to date.
    This Threadinar will discuss 4 components in the "Components Palette: Layout Section" section of the Creator Component Catalog.
    The components we will focus on today are
    "Page Separator", "Page Fragment Box" , "Tab Set" & "Tab" Components.
    Let us begin our discussion with the "Page Separator" Component.
    Page Separator Component
    You can drag the Page Separator component from the Palette's Layout category to the Visual Designer to create a horizontal line that resizes to any page width selected by the user. This component is the visual equivalent of an HTML <hr> tag.
    In the page bean, a Page Separator component is a PageSeparator object.
    * Note: If you want to use an HTML <hr> tag, drop a Meta component on the page and set its tag property to hr.
    [b]Page Fragment Box Component
    This component enables you to include a page fragment in a page. A page fragment is a separate, reusable part of a page that can be included in any number of pages. For example, you might want to put a common a visual element like a header graphic in a page fragment and then include it in all the pages in an application.
    When you drag the Page Fragment Box component from the Layout category of the Palette and drop it on a page, the Select Page Fragment dialog box prompts you for the name of the page fragment to be included. You can enter the name of an existing page fragment or create a new page fragment. If you create a new page fragment, the IDE gives the new fragment a .jspf file suffix and creates a node for it in the Projects window, as well as adding the page fragment to the Outline window.
    * Note: A Page Fragment Box component simply includes a page fragment in a page. Deleting a Page Fragment Box component from a page does not delete the page fragment itself, even if you originally used the Select Page Fragment dialog box to create the page fragment.
    After dropping a Page Fragment Box component on the page, if you click inside the component, you see the properties for the included fragment. If you click the border of the component, you see the properties for the enclosing <div> block. You can also use the Outline window to select the enclosing block, the page fragment, or the components in the page fragment. In the Outline window, the Page Fragment Box component is represented by a node named directive.include:fragment-file.jspf, where fragment-file is the name of the page fragment file.
    If you double-click the page fragment, it opens as a page in the Visual Editor, enabling you to edit it like a regular page. The page fragment has an associated JavaBeans object, a page fragment bean, which you can edit by clicking the Java button at the top of the page fragment when it is open in the Visual Editor. As with a regular page, if you drop a component like a button in a fragment, double clicking adds an event handler in the page fragment bean, enabling you to reuse the code on any page to which you add the page fragment. A common scenario for reusing component code would be a Search Box fragment that has a search Label, a Text Field where the user enters the search string, some Inline Help, and search logic code in the page fragment bean.
    * The tab order of the components in the page is unlikely to work properly unless you enclose the entire page fragment box in the Faces Verbatim component.
    For more details see tutorial : "Using Page Fragments"
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/pagefragments.html
    [b]Tab Set Component
    The Tab Set component in the Palette's Layout category is a container for a set of Tab components. Typical uses of a tab set are:
    * To provide alternate sets of components on the same page and enable the user to navigate to them by clicking on tabs. The user sees only the components under the currently selected tab. For more information on adding components to tabs, see Tab Component.
    * To navigate among a set of pages. If you use a tab set this way, you would usually have the tab set near the top of each page with the component's width set at 100%. You would use the Page Navigation editor to define each tab to display a page in the application, with the current page's tab set as the selected tab. In addition, you would need to delete the default Layout Panel component under each tab so the tab would display the page contents.
    You can set Tab Set properties in the component's Properties window.
    A Tab Set component contains Tab Components, and Tab components can contain other Tab components. You can see these components displayed as hierarchical nodes in the Outline window after you add a Tab Set to your page.
    You can add a new tab to a tab set in two ways, by right-clicking the Tab Set component and choosing Add Tab or by dropping a new tab component on the Tab Set or on a Tab component.
    You can drop a new tab component on a tab set in the Visual Designer to the right or left of existing tabs to create a new tab at that level. The tabs in a tab set can also be containers for other tabs. If you drop a Tab component on an existing tab, the new tab becomes a child of the tab on which you dropped it. The maximum number of levels for tabs is three.
    The tab set component determines which tab is rendered as selected, storing the value in the selected property. By default, the selected property is set to the first tab created for the component. If you click a tab while designing your web page, that tab becomes the selected tab. You can tell during design time that a tab is selected because its color changes.
    [b]Tab Component
    A Tab is part of a Tab Set component. You can add a new tab to a tab set in two ways, by right-clicking the Tab Set component and choosing Add Tab or by dragging a new Tab component from the Layout category of the Palette and dropping it on the Tab Set or on another Tab component. You can also drag from the Palette and drop the tab on the tab set's nodes in the Outline window.
    * If you drop the Tab component to the left or right of an existing tab, it is added to the same row of tabs.
    * If you drop the Tab component on an existing tab, the dropped tab becomes a child tab of the tab on which you drop it unless the existing tab is a third level tab. You can have at most three levels of tabs in a tab set.
    o Note: You cannot add a child tab to a tab that has components in its Layout Panel. When you drop a tab on an existing tab component that has an empty Layout Panel, the empty Layout Panel is deleted to make room for the dropped tab.
    By default, a Tab component has a Layout Panel below it where you can drop components that will be displayed when the user selects the tab. The Layout Panel by default has its panelLayout property set to Grid Layout, meaning that components dropped on the panel are aligned at the location where they are dropped. You can change the layout behavior by setting the panelLayout property to Flow Layout, which aligns dropped components left to right in rows. For more information on Layout Panel properties, see Layout Panel Component Properties Window.
    To select a tab in a tab set, either click the Tab component on the page or select the Tab component's node in the Outline window. To select the whole tab set, either click the border of the Tab Set component on the page or select the tab set's node in the Outline window. Alternatively, you can select a Tab component and either press Escape or right-click and choose Select Parent to select its parent component.
    * Note: If you select a tab on a page in the Visual Designer, a side effect is that it becomes the selected tab. If this effect is not what you want, select the tab in the Outline window so you can set its properties.
    You can drag tabs in the Outline window to change their location and level in the tab set.
    Some typical uses of tabs:
    * You can drop components on the Layout Panel component below a tab to enable a set of components to be displayed below each tab. When the user selects a tab, they see only the components that are associated with the tab, without having to change pages.
    * You can use a tab set to navigate among a set of pages. Each tab component links to a page in your web application. You would use the Page Navigation editor to define each tab to display a page in the application, with the current page's tab set as the selected tab. If you want to use the tab set for page navigation, be sure to delete each tab component's Layout Panel.
    You can also right-click the Tab component and choose one of the following options:
    * Edit action Event Handler. Code the action event handler, the method that is called when the user clicks the tab. This method determines which page or resource to open based on specified conditions. The action method typically processes mouse clicks and returns a string indicating the name of a page navigation case (the page in your application to display next). The default name for the method is tab-id_action, where tab-id is the value of the tab's id property.
    * Bind to Data. Dynamically set the text that appears on the tab. You can bind the component's text property to an object or a data provider, as described in the topic Bind to Data Dialog Box.
    * Property Bindings. Opens a dialog box that enables you to bind properties of the component in addition to the text property to other objects or bean properties that update this component's properties automatically.
    [b] Please join in and share your comments, experiences, additional information, questions, feedback, etc. on these components. <br><br>
    Thank you for your participation

    The following blog has a mini tutorial on using a tab set in a page fragment for page navigation:
    http://blogs.sun.com/divas/entry/tabbing_thru_the_tulips
    A reader commented that the mini tutorial needed to be improved upon to show how to keep the tab state and navigation state in synch.
    How would you do it? If you have a good example, maybe post it to this thread.
    Also, there is no tab tutorial but it is on the priority list. What would you like a tab tutorial to show how to do?

  • Clear loaded pictures in xml gallery to load another set

    i cannot figure how to unload my already populated xml gallery, before loading new content :
    here the functions i want :
    //following 2 functions will be called by a button :
    // removes previously placed objects
    function clearLoadedPictures():void {
    // Load another ,xml to load new pictures set - ok : works fine
    function LoadNewPictures():void {
            i_g = 0;
               // xml data
                var xml_gallery:XML                = new XML();
                var xml_gallery_List:XMLList        = new XMLList;
                // XML data loader...
                var xmlUrlReq:URLRequest   = new URLRequest("xml/gallery2.xml");// gallery2.xml will replace gallery.xml already loaded
                var xml_gallery_UrlLoader:URLLoader = new URLLoader(xmlUrlReq);
                xml_gallery_UrlLoader.addEventListener(Event.COMPLETE, xml_gallery_Complete);
                xml_gallery_UrlLoader.addEventListener(IOErrorEvent.IO_ERROR, xml_gallery_LoadFailed);
    here the xml gallery code :
    var _mc:item;
    var total:int;
    var i_g:int;
    var id:int;
    var btn_Gallery_Ready:Boolean;
    var speedX:Number;
    var spaceR:Number;
    var img_gallery_Loader:Loader;
    i_g = 0;
               // xml data
                var xml_gallery:XML                = new XML();
                var xml_gallery_List:XMLList        = new XMLList;
                // XML data loader...
                var xmlUrlReq:URLRequest   = new URLRequest("xml/gallery.xml");
                var xml_gallery_UrlLoader:URLLoader = new URLLoader(xmlUrlReq);
                xml_gallery_UrlLoader.addEventListener(Event.COMPLETE, xml_gallery_Complete);
                xml_gallery_UrlLoader.addEventListener(IOErrorEvent.IO_ERROR, xml_gallery_LoadFailed);
                bottom24.gallery.content_mc.addEventListener(MouseEvent.ROLL_OVER, startScroll);
                bottom24.gallery.content_mc.addEventListener(MouseEvent.ROLL_OUT, stopScroll); //
    // xmlComplete function
            function xml_gallery_Complete(e:Event):void
            xml_gallery = XML(e.target.data); //
                xml_gallery_List = xml_gallery.item;  // <item> in gallery.xml
                total = xml_gallery_List.length();
                spaceR = xml_gallery.attribute("space"); // specified in gallery.xml file as is : <gallery space="119" speed="0.2">
                speedX = xml_gallery.attribute("speed");
                init_gallery();
            function xml_gallery_LoadFailed(e:IOErrorEvent):void {
                trace("Load Failed: " + e);
            function init_gallery()  //
                //bottom.gallery.content_mc.itemHolder_mc.
                _mc = new item(); //
                _mc.alpha = 0;
                //_mc.imgMask_mc.scaleY = 0;  // condition pour apparition des timbres ds la gallery - OLD
                _mc.imgMask_mc.alpha = 0; // condition pour apparition des timbres ds la gallery - NEW
                _mc.x = i_g * spaceR;
                _mc.btn.id = i_g;
                _mc.btn.mouseChildren = false;
                bottom24.gallery.content_mc.itemHolder_mc.addChild(_mc);
                Tweener.addTween(_mc, {alpha:1, time:0.8, transition:"easeOutExpo"});
                _mc.online_mc.alpha = 0; //invisible sans roll over
                if (xml_gallery_List[i_g].url != "")
                    _mc.btn.buttonMode = true;
                    _mc.online_mc.visible = true;
                    btn_Gallery_Ready = true;
                else
                    _mc.btn.buttonMode = false;
                    _mc.online_mc.visible = false;
                    btn_Gallery_Ready = false;
            var imgRequest:URLRequest = new URLRequest (xml_gallery_List[i_g].image); //
             img_gallery_Loader = new Loader(); // var imgLoader:Loader;
                img_gallery_Loader.load(imgRequest); //
                img_gallery_Loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, imgLoading);
                img_gallery_Loader.contentLoaderInfo.addEventListener(Event.COMPLETE, img_gallery_Complete);
                i_g++;
            function imgLoading(event:ProgressEvent):void // tiny preloader in bottom thumbs pics
        _mc.preloader_mc.width = Math.round(img_gallery_Loader.contentLoaderInfo.bytesLoaded / img_gallery_Loader.contentLoaderInfo.bytesTotal * 100);
            function img_gallery_Complete(event:Event):void
                _mc.imgHolder_mc.addChild(img_gallery_Loader);
                Tweener.addTween(_mc.imgHolder_mc, {_saturation:0.9, time:0.6});// desaturate scrolling thumbs
                //_mc.imgHolder_mc.alpha = 0.5; // test
                // apparition des timbres ds la gallery, ici fade in : - NEW
                Tweener.addTween(_mc.imgMask_mc, {"alpha":1, delay:i_g / 20, time:0.4, transition:"easeOutExpo"});// test
                // apparition des timbres ds la gallery, ici image apparait de haut en bas : - OLD
                //Tweener.addTween(_mc.imgMask_mc, {"scaleY":1, delay:i_g / 10, time:1, transition:"easeOutExpo"});
                // la ligne de preloader qui diminue vers la gauche :
                Tweener.addTween(_mc.preloader_mc, {"scaleX":0, delay:0, time:1, transition:"easeOutExpo"});
                _mc.btn.addEventListener(MouseEvent.ROLL_OVER, onMouseOver);
                _mc.btn.addEventListener(MouseEvent.ROLL_OUT, onMouseOut);
                _mc.btn.addEventListener(MouseEvent.CLICK, onMouseClick);
                if (i_g < total)
                    init_gallery();
    thanks

    hi,
    back to work,
    then i used a loop in the first clear function:
    var n:int = 0;
                  while (n < xml_gallery_List.length() -1) {
                      bottom24.gallery.content_mc.itemHolder_mc.removeChildAt(n); //
                    i++;
    and it remove all my previously loaded pictures,but it throw me an error :
    RangeError: Error #2006: The supplied index is out of bounds.
    at flash.display: DisplayObjectContainer/removeChildAt()
    it seems error come from the removeChildAt, but i can't figure out what's wrong
    i've tried to replace removeChildAt(n); by removeChild(n); and the loop crash Flash software....
    any suggestion ?

  • How do I pull XML data by a node name?

    I am new to Flash and XML so I hope I am not asking a
    completely dumb question. I have figured out how to retrieve data
    from and XML file by the node possition but now I would like to
    know how to pull it by a specific node name. Here is what I
    currently have:
    on (rollOver)
    myLot = 1;
    _root.myInfo =
    _root.myXML.childNodes[0].childNodes[this.myLot].childNodes[0].childNodes[0].nodeValue;
    With XML file like this:
    <SectionOne>
    <Lot1>
    <Lot>1</Lot>
    <Price>$450,000</Price>
    <Status>Active</Status>
    </Lot1>
    <Lot4>
    <Lot>4</Lot>
    <Price>$389,000</Price>
    <Status>Sold</Status>
    </Lot2>
    </SectionOne>
    What I would like is to pull instead of
    childNodes[this.myLot] to pull the node named Lot1. The problem I
    have is I don't always have consecutive lot numbers and I don't
    want to have to build in blank xml lines for a placeholder. I hope
    that makes sense.

    Sorry for the delay. I originally posted this on the
    newsgroup, but I suppose it did not propagate to here.
    What you would do is use a loop statement and compare the
    nodeNames.
    To see a nodes name such as Lot1 you use:
    childNodes[x].nodeName
    // Load up the lotNodes object
    lotNodes = _root.myXML.childNodes[0];
    // Now lotNodes contains all the nodes Lot0, Lot1, Lot2.....
    // Iterate through all of lotNodes childNodes and compare the
    // nodeName until you find the one you want then drill down
    // it to get the info you want.
    for( var counter01 = 0;counter01 <
    lotNodes.childNodes.length;counter01++){
    if(lotNodes.childNodes[counter01].nodeName == "Lot1"){
    myInfo =
    lotNodes.childNodes[counter01].childNodes[0].childNodes[0].nodeValue;
    I have not had time to test this but it should work, I'll
    double check it after work.
    I hope this helps get you moving forward.
    If you have any other problems or can't get it to work, let
    me know here or email me. Preferably here, so others can learn and
    help.
    Scotty
    [email protected]

Maybe you are looking for

  • How to fetch,update,insert the data using database link on diff. servers

    I am using two oracle server. 1st) Oracle 9i ( Server1 ) 2nd) Oracle 10g ( Server2 ) 3) Forms 6i I have created a database link on Server 1 for connecting to Server 2. I written a piece of code which will be executed in Forms 6i and is connected to S

  • Problems with static IP from TP-Link Access Point

    Hello Guys! I'm new with Apple - i got a Macbook Pro Mid 2012 since 2 weeks. Everythings running fine and im really happy with the Macbook - except of the Wifi. I have the problem that the internet connection is just working temporarily, sometimes it

  • How to delete time machine backups from trash bin

    Hello, I've got a little issue with time machine and doing something stupid on my part. I have seen different posts on this question, but it appears that most people haven't found a working solution, so I want to see if anybody has more insight. A fe

  • Daily  Attendance Report

    HI SAP GURUS Is there any report in sap for checking the attendance for absence on a daily basis for all employees. Regards Surupa

  • Problem loading hierarchy long text. Item text only displays 45 characters

    Hi, When loading the Financial Statement hierarchy from ECC to BI I am only getting a 45 character long text for the nodes. This text seems to correspond to the "Item" text seen in transaction fse3 in ECC. However, the text that I need to have is the