About transformation from xml to html

Hello all, I have just learnt xml for a week.
I am preparing to use servlet and Jsp to convert xml to html,
but I wonder how to make the convertion.
Since the xml source is not in well design,
I would like to ask what does the suitable way to do.
The xml source is about the typesetting in a page.
<book> element indicate a book
<page> - element indicate a page
attribute:
id - id of the page
height - height of the page
width - width of the page
<area> element indicate a area
attribute:
pos - in the form of "x1, y1, x2, y2",
(x-coordindate starting from left side of the page)
(y coordinate starting form top side oft the page)
<line> element indicate a line
attribute:
start - the x-coordinate, starting from left
width - the width of the line
<words> element indicate a word
attribute:
top - the y-coordinate, starting from top
height - the height of the words
all of them are defined as empty tag, except <book>
example:
<book>
     <page id=1 height=100, width=200/>
     <area pos"10,10,20,20"/>
     <line start=11 width=5/>
     <words top=11, height=5>
     word1
     <words top=16, height=2/>
     word2
     <page id=2 height=100, width=250/>
</book>
I would like to transfer page, area, line+words into 3 different of layer in html.
I have try to use xslt style sheet (xsl),
but I find difficulty getting information from element to form a layer and building up the template.
For example, how can I get attributes info from two elements and generate a layer(html).
Or, does it better to do the transformation in servlet and read the xml as a DOM tree?
Furthermore, I would like to ask does it need much time to convert source to html,
as there is nearly 4 thousand line in a xml file?
Thanks!!

Steve tks for Your suggestions, but my problem is a little different from the one You illustrate (or I didn't understand well Yur suggestion).
1 - I don't use BC4J in this project
2 - I don't need to insert data in the DB but only receive the data from an HTML form as a XML Document.
I understand the idea You gave me would be a good basis for the solution but I don't understand how I can apply it.
TIA
Tullio

Similar Messages

  • Urgent! How to suppress indents in output from (XML , XSL) -- HTML

    I make transformation (XML , XSL) --> HTML using parser v2 of Oracle XDK for Java v 9.2.0.2.0
    I want to generate html in which several tags will follow one after another without new line, and indents.
    Like this
    <html>
    <body>
    <img src="1.jpg"/><img src="2.jpg"/>
    </body>
    </html>
    Only in this case images will be visualized in IE5 together without spaces.
    But xsl-processor is formatting output text: put each tag on new line and make indents for child tags.
    I tried to
    1) eliminate white spaces in xsl
    2) use <xsl:output indent="no"/>
    3) use <xsl:strip-space elements="*"/>
    4) use method setPreserveWhitespace(true/false) of XMLParser (oracle.xml.parser.v2.XMLParser)
    Xsl-processor continue to format output text.
    my xml
    <list>
    <element name="1.jpg" />
    <element name="2.jpg" />
    </list>
    my xsl
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html" indent="no"/>
    <xsl:strip-space elements="*"/>
    <xsl:template match="list">
    <html><body>
    <img src="{element[1]/@name}"/><img src="{element[2]/@name}"/>
    </body></html>
    </xsl:template>
    </xsl:stylesheet>
    html-output
    <html>
    <body>
    <img src="1.jpg"/>
    <img src="2.jpg"/>
    </body>
    </html>
    Please help me!

    html-output
    <html>
    <body>
    <img src="1.jpg"/>
    <img src="2.jpg"/>
    </body>
    </html>
    Please help me!

  • Writing XSLT to perform transformation from XML to ABAP

    Hi,
    I've been struggling quite a bit with XSLT. I read several old discussions regarding transformations using ST and XSLT but I haven't been able to solve my problem.
    I have a requirement to build a program to convert XML to an internal table.
    I've been able to do it for smaller XMLs, but whenever I try to apply the same logic to a bigger XML it simply just doesn't work. I'm almost certain it has something to do with the way I wrote the XSLT but I haven't been able to figure out what.
    The XML I have to read from goes something like this:
    <?xml version="1.0" encoding="WINDOWS-1252"?>
    -<AuditFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:OECD:StandardAuditFile-Tax:PT_1.02_01">
         -<Header xmlns="urn:OECD:StandardAuditFile-Tax:PT_1.02_01">
              <AuditFileVersion>1.02_01</AuditFileVersion>
                   <CompanyID>50002</CompanyID>
                   <TaxRegistrationNumber>5000</TaxRegistrationNumber>
                   <TaxAccountingBasis>F</TaxAccountingBasis>
                   <CompanyName>Company</CompanyName>
                   <BusinessName>Business</BusinessName>
                   -<CompanyAddress>
                        <AddressDetail>Address</AddressDetail>
                        <City>city</City>
                        <PostalCode>333333</PostalCode>
                        <Country>PT</Country>
                   </CompanyAddress>
                   <FiscalYear>2013</FiscalYear>
                   <StartDate>2013-07-01</StartDate>
                   <EndDate>2013-07-31</EndDate>
                   <CurrencyCode>EUR</CurrencyCode>
                   <DateCreated>2013-08-02</DateCreated>
                   <TaxEntity>Global</TaxEntity>
                   <ProductCompanyTaxID>00</ProductCompanyTaxID>
                   <SoftwareCertificateNumber>00</SoftwareCertificateNumber>
                   <ProductID>product</ProductID>
                   <ProductVersion>00</ProductVersion>
                  <Email>email@com</Email>
                   <Website>www.s.pt</Website>
         </Header>
         -<MasterFiles xmlns="urn:OECD:StandardAuditFile-Tax:PT_1.02_01">
              -<Customer>
                   <CustomerID>1</CustomerID>
                   <AccountID>ID</AccountID>
                   <CustomerTaxID>999999990</CustomerTaxID>
                   <CompanyName>Desconhecido</CompanyName>
                   -<BillingAddress>
                        <AddressDetail>Desconhecido</AddressDetail>
                        <City>Desconhecido</City>
                        <PostalCode>0000-000</PostalCode>
                        <Country>PT</Country>
                   </BillingAddress>
                   <SelfBillingIndicator>0</SelfBillingIndicator>
              </Customer>
              -<Customer>
                   <CustomerID>2</CustomerID>
                   <AccountID>Desconhecido</AccountID>
                   <CustomerTaxID>571</CustomerTaxID>
                   <CompanyName>Company</CompanyName>
                   -<BillingAddress>
                        <AddressDetail>detail</AddressDetail>
                        <City>city</City>
                        <PostalCode>0000-000</PostalCode>
                       <Country>PT</Country>
               </BillingAddress>
              <SelfBillingIndicator>0</SelfBillingIndicator>
         </Customer>
    ...and so on
    And the XSLT I've written so far is something like this:
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
       <xsl:output encoding="iso-8859-1" indent="yes" method="xml" version="1.0"/>
       <xsl:strip-space elements="*"/>
       <xsl:template match="/">
         <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
           <asx:values>
             <ICUSTOMER>
               <xsl:apply-templates select="//Customer"/>
             </ICUSTOMER>
           </asx:values>
         </asx:abap>
       </xsl:template>
       <xsl:template match="Customer">
         <item>
           <CUSTOMER_ID>
             <xsl:value-of select="CustomerID"/>
           </CUSTOMER_ID>
           <ACCOUNT_ID>
             <xsl:value-of select="AccountID"/>
           </ACCOUNT_ID>
           <CUSTOMERTAX_ID>
             <xsl:value-of select="CustomerTaxID"/>
           </CUSTOMERTAX_ID>
           <COMPANYNAME>
             <xsl:value-of select="CompanyName"/>
           </COMPANYNAME>
           <ADDRESSDETAIL>
             <xsl:value-of select="BillingAddress/AddressDetail"/>
           </ADDRESSDETAIL>
           <CITY>
             <xsl:value-of select="BillingAddress/City"/>
           </CITY>
            <POSTALCODE>
             <xsl:value-of select="BillingAddress/PostalCode"/>
           </POSTALCODE>
            <COUNTRY>
             <xsl:value-of select="BillingAddress/Country"/>
           </COUNTRY>
           <SELFBILLINGINDICATOR>
             <xsl:value-of select="SelfBillingIndicator"/>
           </SELFBILLINGINDICATOR>
         </item>
       </xsl:template>
    </xsl:transform>
    Like I said, I'm almost certain that the problem is with the XSLT, as it returns an empty table / ALV. I've used this method before and it worked...
    Any thoughts?
    Thank you

    Hello Goncalo,
    I think, there are two problems:
    1) The xmlns declaration within your xml is a problem for the SAP XSLT Processor.
    2) I have written a similar XSLT-report, which performs directly with your data. Perhaps this is not necessary if 1) is solved:
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">
       <xsl:output encoding="iso-8859-1" indent="yes" method="xml" version="1.0"/>
       <xsl:strip-space elements="*"/>
       <xsl:template match="AuditFile">
         <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
           <asx:values>
              <xsl:apply-templates select="MasterFiles"/>
           </asx:values>
         </asx:abap>
       </xsl:template>
       <xsl:template match="MasterFiles">
             <ICUSTOMER>
               <xsl:apply-templates select="./Customer"/>
             </ICUSTOMER>
       </xsl:template>
       <xsl:template match="Customer">
           <CUSTOMER_ID>
             <xsl:value-of select="CustomerID"/>
           </CUSTOMER_ID>
           <ACCOUNT_ID>
             <xsl:value-of select="AccountID"/>
           </ACCOUNT_ID>
           <CUSTOMERTAX_ID>
             <xsl:value-of select="CustomerTaxID"/>
           </CUSTOMERTAX_ID>
       </xsl:template>
    </xsl:transform>
    Kind regards,
    Hendrik

  • XSLT Transformation from XML to CVS format

    I am using the following xsl sheet in conjunction with the XSLSample.java application delivered with xdk and cannot get the output I desire. Does Orcales xsl processor output text documents?
    XSL:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="text"/>
    <xsl:template match="/">
    <xsl:apply-templates select="ROWSET/ROWS[1]/*" mode="elementNames"/>
    <xsl:apply-templates select="ROWSET/ROWS"/>
    </xsl:template>
    <xsl:template match="*" mode="elementNames">
    <xsl:value-of select="name()"/>
    <xsl:choose>
    <xsl:when test="position() != last()">,</xsl:when>
    <xsl:otherwise>
    <xsl:text>&#xa;</xsl:text>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    <xsl:template match="ROW">
    <xsl:apply-templates select="*"/>
    </xsl:template>
    <xsl:template match="*">
    <xsl:if test="contains(.,' ')">"</xsl:if>
    <xsl:value-of select="."/>
    <xsl:if test="contains(.,' ')">"</xsl:if>
    <xsl:choose>
    <xsl:when test="position() != last()">,</xsl:when>
    <xsl:otherwise>
    <xsl:text>&#xa;</xsl:text>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    </xsl:stylesheet>
    XML:
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <CUST_ID>1000000009</CUST_ID>
    <NAME1>Pineview Preschool</NAME1>
    <ITEM>0000000007</ITEM>
    <POST_DATE>01/02/2001</POST_DATE>
    <ENTRY_TYPE>PY</ENTRY_TYPE>
    <DOCUMENT> </DOCUMENT>
    </ROW>
    <ROW num="2">
    <CUST_ID>1000000006</CUST_ID>
    <NAME1>Cellular One</NAME1>
    <ITEM>0000000008</ITEM>
    <POST_DATE>01/02/2001</POST_DATE>
    <ENTRY_TYPE>PY</ENTRY_TYPE>
    <DOCUMENT> </DOCUMENT>
    </ROW>
    </ROWSET>
    Any help for this xsl beginner would be greatly appreciated.
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Steven Muench ([email protected]):
    The problem is likely that you are incorrectly using:
    [b]DocumentFragment processXSL(xsl,xml)
    instead of the other API:
    void processXSL(xsl,xml,PrintWriter)
    the latter allows the XSLT engine to do its <xsl:output> serialization behavior. The former does not.<HR></BLOCKQUOTE>
    Thanks Steve,
    I am now doing that. How can I get rid of the top level xml tag that prints out after applying the xsl sheet. I need a simple text file with just the data.
    Thanks,
    Jeff
    null

  • XSLT Transformation from XML to ABAP  field

    Hi all,
    How can I retrieve my XML node's value (EMPLOYEE) XML to an ABAP variable (W_KUNNR)
      DATA w_kunnr TYPE string.
      CONCATENATE
        '<services>'
        '<Myservice>'
        '<APPLICATION>APPLI1</APPLICATION>'
        '<SERVICE>SERV1</SERVICE>'
        '<TOSAP>'
        '<EMPLOYEE>00000036</EMPLOYEE>'
        '</TOSAP>'
        '</Myservice>'
        '</services>'
      INTO request.
      CALL TRANSFORMATION z_trans
      SOURCE XML request
      RESULT kunnr = w_kunnr.
    thanks.
    Edited by: Noureddine MOUTAA on Oct 28, 2008 2:25 PM

    I did like this:
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <xsl:output encoding="iso-8859-1" indent="yes" method="xml" version="1.0"/>
      <xsl:strip-space elements="*"/>
      <xsl:template match="/">
        <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
          <asx:values>
            <KUNNR>
              <xsl:value-of select="//services/Myservice/TOSAP/EMPLOYEE"/>
            </KUNNR>
          </asx:values>
        </asx:abap>
      </xsl:template>
    </xsl:transform>

  • Tuxedo Response Transformation from XML to FML

    Request flow :Tuxedo -> OSB Proxy Service > OSB Business Serivice >Target Web Service.
    Response flow : Target Web Service send response to -> Business Service ->OSB Proxy serivice (Transforma the Complex XML to FML) ->send to Tuxedo Client.
    i have following response form webserive call
    <StudentList>
    <Student universitytype="AU " accurrence = 'undbounded'>
    <stdname>
    <stdyear>
    <stdscore>
    <Student/>
    <Student universitytype="AU " accurrence = 'undbounded'>
    <stdname>
    <stdyear>
    <stdscore>
    <Student/>
    <Student universitytype="MIT" accurrence = 'undbounded'>
    <stdname>
    <stdyear>
    <stdscore>
    <Student/>
    <Student universitytype="AO " accurrence = 'undbounded'>
    <stdname>
    <stdyear>
    <stdscore>
    <Student/>
    <StudentList/>
    can i transform above complexity form of XML to FML using XmlFmlCnv Class and send it to Tuxedo
    Since FML is flat strucured, i am not sure how the Complex ty

    Hello,
    It depends on the release of WebLogic and the field table definitions used by WTC (and Tuxedo).
    I believe embedded/nested FML32 fields were added to XmlFmlCnv in WLS 9.0 (but the doc needs to be updated).
    Have you tried this yet?
    Regards,
    Bob Finan

  • Do you need to generate HTML table rows from XML in InDesign?

    General issue: you export XML and you get a bunch of content for xml elements that were a table in inDesign. But they don't have any rows, just cell after cell. What will make rows in your output?
    Solution: XSLT; you need to use the @aid:tcols attribute of exported XML to determine the number of columns that your table should be. This is written in XSLT 1.1 so it shoud work with an export from InDesign. If you have problems with using it on export of XML, try using it on the XML afetr it has been exported, in Oxygen or other XSLT processor. Best to save acopy of your files before using the XSLT with them.  Copy all of the plain text and past into a new file, save with your own filename, ending with .xsl file extension. Then when exporting XML from InDesign CS3-5, browse to your new .xsl file and select it. PLEASE read about XSLT files at w3c.schools or other resource if you want to understand what is going on with this file.
    BTW <!-- indicates comments in code -->
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- NO WARRANTY that this example code will work as written for your XML file in InDesign. You can add more templates to the output to map your heading styles to h1, h2, etc. -->
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1"
        xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/"
        xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/" exclude-result-prefixes="xsl aid aid5">
        <xsl:output method="html" indent="yes" encoding="UTF-8"
            doctype-public="http://www.w3.org/TR/xhtml/DTD/xhtml-transitional.dtd"/>
    <!-- parameter to use the name of element with attribute aid:theader as the th output -->
        <xsl:param name="tableElem">//*[local-name()][@aid:table='table']</xsl:param>
        <xsl:param name="colheadStyle">
            <xsl:value-of select="//*[local-name()][@aid:theader][1]"/>
            <!-- i.e. colHead-->
        </xsl:param>
    <!-- parameter to use the name of element with attribute aid:cell but not aid:theader as the td  output -->
    <!--i.e. tabletext or whatever the name of your Cell level  element is in InDesign -->
        <xsl:param name="cellStyle">
            <xsl:value-of select="//*[local-name()][@aid:table='cell' and not(@aid:theader)][1]"/>
        </xsl:param>
        <!-- handles a Story element marked up with HTML-type elements, but uses the <Table> element of IDD  -->
        <!-- if a true HTML table is in the content, it will be passed through -->
        <xsl:template match="Story"><!-- make a basic HTML file from a Story -->
            <html>
                <head>
                    <title>Sample Table</title>
                </head>
                <body>
                    <xsl:apply-templates><!-- will handle direct text of the  <Story>, and <Table> -->
                        <xsl:with-param name="colheadStyle" select="$colheadStyle"/>
                        <xsl:with-param name="cellStyle" select="$cellStyle"/>
                    </xsl:apply-templates>  
                </body>
            </html>
        </xsl:template>
       <!-- use the styles to find the elements of IDD <Table> element -->
        <xsl:template match="Table">
            <xsl:param name="colheadStyle">
                <xsl:value-of select="$colheadStyle"/>
            </xsl:param>
            <xsl:param name="cellStyle">
                <xsl:value-of select="$cellStyle"/>
            </xsl:param>
            <xsl:variable name="cellsPerRow">
                <xsl:value-of select="@aid:tcols"/>
            </xsl:variable>
            <table><!-- start the table -->
                <!-- xhtml requires lower-case name for table element-->
                <tr>
                    <xsl:apply-templates select="*[@aid:theader='']">
                        <xsl:with-param name="colheadStyle" select="$colheadStyle"/>
                        <xsl:with-param name="cellStyle" select="$cellStyle"/>
                    </xsl:apply-templates>
                </tr>
                <!--  and @aid:style=$cellStyle -->
                <xsl:for-each
                    select="*[@aid:table='cell'][not(@aid:theader='')][position() mod $cellsPerRow = 1]">
    <!-- some code adapted with  permission, from http://www.computorcompanion.com/LPMArticle.asp?ID=202
    Building HTML Tables with XSL by James Byrd; please include this acknowledgement in all files that use his code -->
    <!-- this is the tricky bit of the code that James Byrd set up
    p-class-tabletext-[position() mod $cellsPerRow = 1 continues looping until the position of the active element divided by $cellperRow (@aid:tcols value) tried with [@aid:style=$cellStyle] has a remainder of 1 -->
    <!--  .|following-sibling::p-class-tabletext-[position() &lt;  $cellsPerRow] applies first to the currently selects cell with "." then continues with the following-siblings whose position is less than  the value of cells per row (@aid:tcols value) -->
                    <tr>
                        <xsl:apply-templates
                            select=".|following-sibling::*[@aid:table='cell'][not(@aid:theader='')][position() &lt; $cellsPerRow]"
                        />
                    </tr>
                </xsl:for-each>
            </table>
        </xsl:template>
        <xsl:template match="*">
            <xsl:param name="colheadStyle">
                <xsl:value-of select="$colheadStyle"/>
            </xsl:param>
            <xsl:param name="cellStyle">
                <xsl:value-of select="$cellStyle"/>
            </xsl:param>
            <xsl:variable name="cellsPerRow">
                <xsl:value-of select="parent::Table/@aid:tcols"/>
            </xsl:variable>
            <xsl:choose>
                <!-- colHead aid:table="cell" aid:theader=""-->
                <xsl:when test="parent::Table and @aid:theader">
                    <th>
                        <xsl:apply-templates>
                            <xsl:with-param name="colheadStyle" select="$colheadStyle"/>
                            <xsl:with-param name="cellStyle" select="$cellStyle"/>
                        </xsl:apply-templates>
                    </th>
                    <xsl:if test="(position() = last()) and (position() &lt; $cellsPerRow)">
                        <xsl:call-template name="FillerCells">
                            <xsl:with-param name="cellCount" select="$cellsPerRow - position()"/>
                        </xsl:call-template>
                    </xsl:if>
                </xsl:when>
                <xsl:when test="parent::Table and @aid:table='cell' and not(@aid:theader)">
                    <td>
                        <xsl:apply-templates>
                            <xsl:with-param name="colheadStyle" select="$colheadStyle"/>
                            <xsl:with-param name="cellStyle" select="$cellStyle"/>
                        </xsl:apply-templates>
                    </td>
                    <xsl:if test="(position() = last()) and (position() &lt; $cellsPerRow)">
                        <xsl:call-template name="FillerCells">
                            <xsl:with-param name="cellCount" select="$cellsPerRow - position()"/>
                        </xsl:call-template>
                    </xsl:if>
                </xsl:when>
    <!-- for non-table elements this generic element handler will  pick up an aid:pstyle (if present) and create a class attribute from it. Works for any element that has the same name as HTML element such as <p> but it doesn't add wrapper elements like <ul> or <ol> for lists. -->
                <xsl:otherwise>
                    <xsl:element name="{name()}">
                        <xsl:if test="@aid:pstyle">
                            <xsl:attribute name="class">
                                <xsl:value-of select="@aid:ptyle"/>
                            </xsl:attribute>
                        </xsl:if>
                        <xsl:apply-templates>
                            <xsl:with-param name="colheadStyle" select="$colheadStyle"/>
                            <xsl:with-param name="cellStyle" select="$cellStyle"/>
                        </xsl:apply-templates>
                    </xsl:element>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:template>
        <!-- take care of text that is a direct child of the <Story> by wrapping it in a <p> to make valid HTML -->
        <xsl:template match="text()">
            <xsl:variable name="myString">
                <xsl:value-of select="string-length(normalize-space(.))"/>
            </xsl:variable>
            <xsl:choose>
                <xsl:when test="parent::Story">
                    <xsl:if test="$myString > 0">
                        <xsl:element name="p">
                            <xsl:attribute name="class">text</xsl:attribute>
                            <xsl:value-of select="normalize-space(.)"/>
                        </xsl:element>
                    </xsl:if>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="normalize-space(.)"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:template>
       <!-- make br element conform to good HTML markup -->
        <xsl:template match="br">
            <br />
        </xsl:template>
        <!-- this recursive template calls itself until its test condition is satified -->
        <!-- it outputs a cell whose only content is a non-breaking space -->
        <!-- do not use   in place of Unicode &#160; for the non-breaking space -->
        <!-- the value of $cellCount is set in the main XSL template -->
        <xsl:template name="FillerCells">
            <xsl:param name="cellCount"/>
            <td>&#160;</td>
            <xsl:if test="$cellCount > 1">
                <xsl:call-template name="FillerCells">
                    <xsl:with-param name="cellCount" select="$cellCount - 1"/>
                </xsl:call-template>
            </xsl:if>
        </xsl:template>
    </xsl:stylesheet>
    Message was edited by: HoneoyeFalls
    Sample XML file exported from IDD
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <Story><Table xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/" aid:table="table" aid:trows="2" aid:tcols="2"><colHead aid:table="cell" aid:theader="" aid:crows="1" aid:ccols="1" aid:ccolwidth="44">1 colHead</colHead><colHead aid:table="cell" aid:theader="" aid:crows="1" aid:ccols="1" aid:ccolwidth="56">2 colHead</colHead><tabletext aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="44">1 tabletext</tabletext><tabletext aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="56">2 tabletext</tabletext><tabletext aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="44">row 2 1 tabletext</tabletext><tabletext aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="56">row 2 2 tabletext</tabletext></Table>
    <table><tr><th>normal HTML table heading</th></tr>
    <tr><td>normal HTML table<br/>cell text</td></tr></table></Story>

    You can use RECORD type declaration:
    SQL> declare
      2   type rec_type is record (
      3    ename emp.ename%type,
      4    sal emp.sal%type
      5   );
      6   type rc is ref cursor return rec_type;
      7   rc1 rc;
      8   rec1 rec_type;
      9  begin
    10   open rc1 for select ename, sal from emp;
    11   loop
    12    fetch rc1 into rec1;
    13    exit when rc1%notfound;
    14    dbms_output.put_line(rec1.ename || ' ' || rec1.sal);
    15   end loop;
    16   close rc1;
    17  end;
    18  /
    SMITH 800
    ALLEN 1600
    WARD 1250
    JONES 2975
    MARTIN 1250
    BLAKE 2850
    CLARK 2450
    SCOTT 3000
    KING 5000
    TURNER 1500
    ADAMS 1100
    JAMES 950
    FORD 3000
    MILLER 1300or use, for example, VIEW to declare rowtype:
    SQL> create view dummy_view as select ename, sal from emp;
    View created.
    SQL> declare
      2   type rc is ref cursor return dummy_view%rowtype;
      3   rc1 rc;
      4   rec1 dummy_view%rowtype;
      5  begin
      6   open rc1 for select ename, sal from emp;
      7   loop
      8    fetch rc1 into rec1;
      9    exit when rc1%notfound;
    10    dbms_output.put_line(rec1.ename || ' ' || rec1.sal);
    11   end loop;
    12   close rc1;
    13  end;
    14  /
    SMITH 800
    ALLEN 1600
    WARD 1250
    JONES 2975
    MARTIN 1250
    BLAKE 2850
    CLARK 2450
    SCOTT 3000
    KING 5000
    TURNER 1500
    ADAMS 1100
    JAMES 950
    FORD 3000
    MILLER 1300 Rgds.

  • Error in xml to html transform function in 11g(Help needed urgent)

    We are migrating from 9g to 11g.Code given below is working fine with 9g but giving following error while converting xml to html.
    Error:Exception occurred in XML_TO_HTML :ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00609: Function call with invalid number of arguments in 'position (//USER)'.
    Code :<?xml version='1.0'?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:template match="/">
    <HTML>
    <BODY>
    <!--begin header-->
    <xsl:for-each select="AMAP_REMMIT_EMP/HEADERS/HEADER">
    <TABLE border="0" cellpadding="0" cellspacing="0" style="padding:1px" width="100%" height="95" bgcolor="#EAEAEA"><font size="6" face="Arial">amdocs </font>
    <TR >
    <TD width="50%" align="left" ><b/><font size="2" face="Verdana" /> <xsl:value-of select="VENDOR_NAME"/></TD>
    <TD width="50%" align="left"><b/><font size="2" face="Verdana" />Date: <xsl:value-of select="RUN_DATE"/>
    </TD>
    </TR>
    <TR >
    <TD width="50%" align="left" ><b/><font size="2" face="Verdana" /> <xsl:value-of select="ADDRESS"/></TD>
    <TD width="50%" align="left"><b/><font size="2" face="Verdana" /> <xsl:value-of select="TAX_ID"/>
    </TD>
    </TR>
    <TR >
    <TD width="50%" align="left" ><b/><font size="2" face="Verdana" /> <xsl:value-of select="CITY"/> <xsl:value-of select="ZIP"/></TD>
    <TD width="50%" align="left"><b/><font size="2" face="Verdana" />Vendor Number: <xsl:value-of select="OSEK_MURSHE"/>
    </TD>
    </TR>
    <TR >
    <TD width="50%" align="left" ><b/><font size="2" face="Verdana" /> </TD>
    <TD width="50%" align="left"><b/><font size="2" face="Verdana" />Fax Number: <xsl:value-of select="FAX"/>
    </TD>
    </TR>
    </TABLE>
    </xsl:for-each>
    <!--end header-->
    <!--begin lines-->
    <p dir="ltr" align="center">
    <span style="font-family: Arial; text-decoration: underline; font-weight: 700">
    Subject: Remittance Advice</span></p>
    <table border="1" cellspacing="1" width="100%" bgcolor="#C0C0C0">
    <tr>
    <th width="20%"><font face="Arial"><b>Invoice Date</b></font></th>
    <th width="20%"><font face="Arial"><b>Invoice Number</b></font></th>
    <th width="40%"><font face="Arial"><b>Description</b></font></th>
    <th width="20%"><font face="Arial"><b><xsl:value-of select="AMAP_REMMIT_EMP/HEADERS/HEADER/CURRENCY"/> Amount</b></font></th>
    </tr>
    <xsl:for-each select="AMAP_REMMIT_EMP/MERGE_LINE/LINES/LINE">
    <tr>
    <td width="20%" >
    <xsl:attribute name="bgcolor">
    <xsl:if test="position() mod 2 = 0">#DDDDDD</xsl:if>
    <xsl:if test="position() mod 2 = 1">#FFFFCC</xsl:if>
    </xsl:attribute>
    <xsl:value-of select="INVOICE_DATE"/></td>
    <td width="20%" >
    <xsl:attribute name="bgcolor">
    <xsl:if test="position() mod 2 = 0">#DDDDDD</xsl:if>
    <xsl:if test="position() mod 2 = 1">#FFFFCC</xsl:if>
    </xsl:attribute>
    <xsl:value-of select="INVOICE_NUM"/></td>
    <td width="40%" >
    <xsl:attribute name="bgcolor">
    <xsl:if test="position() mod 2 = 0">#DDDDDD</xsl:if>
    <xsl:if test="position() mod 2 = 1">#FFFFCC</xsl:if>
    </xsl:attribute>
    <xsl:value-of select="DESCRIPTION"/></td>
    <td width="20%" >
    <xsl:attribute name="bgcolor">
    <xsl:if test="position() mod 2 = 0">#DDDDDD</xsl:if>
    <xsl:if test="position() mod 2 = 1">#FFFFCC</xsl:if>
    </xsl:attribute>
    <xsl:value-of select="AMOUNT"/></td>
    </tr>
    </xsl:for-each>
    <tr>
    <td width="80%" bgcolor="#FFFFFF" colspan="3" align="right">
    <b>Total Payment:</b></td>
    <td width="20%" bgcolor="#FFFFFF"><xsl:value-of select="//TOTAL"/></td>
    </tr>
    </table>
    <p dir="ltr" align="left"><span style="font-family: Arial"><font size="2">In accordance with your instructions, this amount will be transferred to your <xsl:if test="AMAP_REMMIT_EMP/MERGE_LINE/SITES/SITE/INCLUDE_BANK_DETAILES='Y'">
    account number <xsl:value-of select="AMAP_REMMIT_EMP/MERGE_LINE/LINES/LINE/ACCOUNT"/> in bank
    <xsl:value-of select="AMAP_REMMIT_EMP/MERGE_LINE/LINES/LINE/BANK"/> , branch <xsl:value-of select="AMAP_REMMIT_EMP/MERGE_LINE/LINES/LINE/BRANCH"/>
    on the date of <xsl:value-of select="AMAP_REMMIT_EMP/MERGE_LINE/LINES/LINE/CHECK_DATE"/>.
    </xsl:if>
    <xsl:if test="AMAP_REMMIT_EMP/MERGE_LINE/SITES/SITE/INCLUDE_BANK_DETAILES!='Y'">
    account on the date of <xsl:value-of select="AMAP_REMMIT_EMP/MERGE_LINE/LINES/LINE/CHECK_DATE"/>.
    </xsl:if>
    <xsl:if test="AMAP_REMMIT_EMP/MERGE_LINE/CREDITNOTES/CREDITNOTE/CREDITNOTE>'0'">
    <p>The payment will be credited in two days from the payment date in your account.</p>
    </xsl:if>
    <p>In case this date is not a valid value date in the bank system, the money will be transferred in the next valid value date.</p>
    <xsl:value-of select="AMAP_REMMIT_EMP/MERGE_LINE/NOTES/NOTE/DESCRIPTION"/>
    </font></span></p>
    <TABLE border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" height="50">
    <TR >
    <TD width="60%" ></TD>
    <TD width="40%" align="left"><b/><font size="2" face="Verdana" />Yours sincerely,</TD>
    </TR>
    <TR >
    <TD width="60%" ></TD>
    <TD width="40%" align="left"><b/><font size="2" face="Verdana" /> <xsl:value-of select="AMAP_REMMIT_EMP/MERGE_LINE/LINES/LINE/COMPANY_NAME"/></TD>
    </TR>
    <!--end lines-->
    <!--end trailer-->
    </TABLE>
    <table cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-left-width: 1; border-right-width: 1; border-top-style: solid; border-top-width: 1; border-bottom-width: 1; padding: 0" bordercolor="#111111" width="100%">
    <tr>
    <td width="34%">Alert No:<xsl:value-of select="AMAP_REMMIT_EMP/HEADERS/HEADER/ALERT_ID"/></td>
    <td width="33%">Environment: <xsl:value-of select="AMAP_REMMIT_EMP/HEADERS/HEADER/DB_NAME"/></td>
    <td width="33%">Date:<xsl:value-of select="AMAP_REMMIT_EMP/HEADERS/HEADER/MAIL_DATE"/></td>
    </tr>
    </table>
    <!--end trailer-->
    </BODY>
    </HTML>
    </xsl:template>
    </xsl:stylesheet>
    Thanks in advance.

    #1. We need to see the code that is being used to invoke the stylesheet.
    #2. We need to see the document that is being transformed...
    It's most likely a bug in 9g which has been fixed in 11g...

  • How to use a transformer xml to html

    hi
    I want to develop jsp pages based on xml data, so to construct components with xml data i must use a transformer converting xml to htm. so if there is a better or more generic solution of classes or examples that can help me , i tried to use cocoon but the problem was to use it within a jsp page.
    please to mail me your suggestions or solutions .
    thank you

    Review Xalan/Xerces from the Apache project.
    http://xml.apache.org/xalan-j/index.html
    http://xml.apache.org/xalan-j/usagepatterns.html#servlet
    http://xml.apache.org/xalan-j/samples.html
    Just one method...

  • Xsl transformation from html to text.

    Hi, i want to tranform an html source and produce a output as text. All i want to do is to output values from my input fields in my html source. Any ideas on how i would construct my xsl file.
    example :
    HTML:
    <html>
    <body>
    <input name="od" type="text" value="123">
    <input name="id" type="text" value="456">
    </body>
    </html>
    would simply give :
    123
    456
    Thanks for your help !!!

    Here is what I came up with. I changed the regular HTML into XHTML then created a stylesheet that would use XPath to find and display the values or the value fields:
    test.xml (XHTML version of the HTML you posted)
    ======================================
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="test.xsl"?>
    <html>
    <body>
    <input name="od" type="text" value="123"/>
    <input name="id" type="text" value="456"/>
    </body>
    </html>
    test.xsl
    ======
    <?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>
    <head>
    <title>Input values</title>
    </head>
    <body>
    <xsl:for-each select="html/body/input">
    <xsl:value-of select="@value"/>
    </xsl:for-each>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>
    this gives the desired result.

  • How to convert from xml file to html using java code

    How to convert from xml file to html file using java code

    Get yourself Apache Xalan or Saxon or some XSLT processor
    String styleSheet = "/YourXSLTStylesheet.xsl";
    String dataSource = "/YourXMLDocument.xml";
    InputStream stylesheetSource = TransformMe.class.getResourceAsStream(styleSheet);
    InputStream dataSourceStream = TransformMe.class.getResourceAsStream(dataSource);
    OutputStream transformedOut = new FileOutputStream("filename.html");
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer transformer = tFactory.newTransformer(new StreamSource(stylesheetSource));
    transformer.transform(new StreamSource(dataSourceStream), new StreamResult(transformedOut));You'll also need to learn XSLT if you don't already know that. Here's a good place to start
    http://www.w3schools.com/xsl/

  • How do I generate HTML from XML & XSL using XSL Processor ?

    I want to generate a HTML from XML & XSL using XDK for C on
    linux-8i.
    I run the XSLSample well.
    But it only generate a XML from a XML & a XSL.
    Can any one give me some advise or sample code?

    Just use HTML tags instead of xml tags in your stylesheet, and
    you'll generate HTML instead.
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:template match="/">
        <html>
          <body>
            <xsl:for-each select="ROWSET">
              <table border="1" cellspacing="0">
                <xsl:for-each select="ROW">
                  <tr>
                    <td><xsl:value-of select="EMPNO"/></td>
                    <td><xsl:value-of select="ENAME"/></td>
                  </tr>
                </xsl:for-each>
              </table>
            </xsl:for-each>
          </body>
        </html>
      </xsl:template>
    </xsl:stylesheet>

  • Generate HTML from XML and XSLT

    Hi,
    I have asked in different forum but did not get my answer so asking here again
    i want to generate a HTML file from XML and XSLT in a temp folder and then read it into a java.lang.String, so can email it or write to a database file.
    how can i do it, is there any engine which will merger XML and XSLT and give a HTML file or a String as output
    Ashish

    Hi,
    Follow the simple steps.
    1) Create XML Document (I hope u have it)
    2) Create XSL Stylesheet for your XML document
    3) Put both files in one directory some where in your local system or web server upto u
    4) Invoke the XML document from webbrowser and you are done.
    http://localhost/test/Catalog.xml OR C:\XXXXDIR\test\Catalog.xml
    For Ex: XML File Content, Catalog.xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <?xml-stylesheet type="text/xsl" href="Catalog.xsl"?>
    <catalog>
    <cd>
    <title>Empire Burlesque</title>
    <artist>Bob Dylan</artist>
    <country>USA</country>
    <company>Columbia</company>
    <price>10.90</price>
    <year>1985</year>
    </cd>
    </catalog>
    XSL File Content: Catalog.xsl
    <?xml version="1.0" encoding="ISO-8859-1"?><xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="/">
    <html>
    <body>
    <h2>My CD Collection</h2>
    <table border="1">
    <tr bgcolor="#9acd32">
    <th align="left">Title</th>
    <th align="left">Artist</th>
    </tr>
    <xsl:for-each select="catalog/cd">
    <tr>
    <td><xsl:value-of select="title"/></td>
    <td><xsl:value-of select="artist"/></td>
    </tr>
    </xsl:for-each>
    </table>
    </body>
    </html>
    </xsl:template></xsl:stylesheet>

  • Simple Transformation from Adobe Form XML document to Dictionary structures

    I have an XML document that I am receiving via email (the XML document is generated from an Adobe Interactive form). I would like to write a simple transformation that will map that XML document to a structure and internal table in my ABAP program. I am new to Simple Transformations and I am having trouble working out how to write a simple transformation for this type of XML document. I would prefer to write a custom transformation rather than using the identity transformation (ID). I would appreciate any help you can provide.
    Please refer to the below for an example of the XML file.
    This maps directly to 2 dictionary structures that exist within our system containing all of the same components. PIM_REQUEST_HDR has a corresponding SAP dictionary structure Y_REQUEST_HDR and PIM_REQUEST_ITEMS has a corresponding SAP dictionary structure Y_REQUEST_ITEMS.
    Can anyone help with some instructions or examples of how to create the simple transformation?
    Thanks for your help! We are using ECC 6.0
    Sample XML to be transformed:
    <?xml version="1.0" encoding="UTF-8" ?>
    <data>
    <SFPSY>
      <DATE>2007-07-03</DATE>
      <TIME>07:25:21</TIME>
      <USERNAME>TLCITY</USERNAME>
      <SUBRC>0</SUBRC>
      </SFPSY>
    <PIM_REQUEST_HDR>
      <MANDT />
      <REQ_NUM />
      <REQ_DESC>blah blah blah</REQ_DESC>
      <PROC_AREA>CTC</PROC_AREA>
      <REQUESTED>2007-07-03</REQUESTED>
      <REQUIRED>2007-07-03</REQUIRED>
      <REQUESTOR>TLCITY</REQUESTOR>
      <MOD_TYPE>SAP Note manual changes</MOD_TYPE>
      <SAPNOTE_NUM>59549656</SAPNOTE_NUM>
      <SAPMSG_NUM>0000000000</SAPMSG_NUM>
      <TECH_SCRIPT />
      <REASON />
      <DEV_ENV>ECC6</DEV_ENV>
      <INSTALL_NO>2861655161</INSTALL_NO>
      <BASIS_REL>700</BASIS_REL>
      <REG_STATUS />
      <REJ_REASON />
      <APP_DATE />
      <REJ_DATE />
      <APPROVER />
      <REGISTRATOR />
      <REG_DATE />
      </PIM_REQUEST_HDR>
    <PIM_REQUEST_ITEMS>
    <DATA>
      <MANDT />
      <REQ_NUM />
      <PGMID>R3TR</PGMID>
      <OBJECT>PROG</OBJECT>
      <OBJ_NAME>RSDIJOIJSDOIF</OBJ_NAME>
      <ACCESSKEY />
      </DATA>
    <DATA>
      <MANDT />
      <REQ_NUM />
      <PGMID>R3TR</PGMID>
      <OBJECT>PROG</OBJECT>
      <OBJ_NAME>RRRSDIJOIJS03</OBJ_NAME>
      <ACCESSKEY />
      </DATA>
      </PIM_REQUEST_ITEMS>
      </data>

    I have solved this one with the help of another collegue.
    To simplify, we changed the XML to be as follows:
    [code]
    <?xml version="1.0" encoding="UTF-8" ?>
    <data>
    <PIM_REQUEST>
    <REQ_HDR>
      <MANDT />
      <REQ_NUM />
      <REQ_DESC>Key required for pricing routines</REQ_DESC>
      <PROC_AREA>SD</PROC_AREA>
      <REQUESTED>2007-07-30</REQUESTED>
      <REQUIRED>2007-08-02</REQUIRED>
      <REQUESTOR>TLCITY</REQUESTOR>
      <MOD_TYPE>SAP Note: Manual Changes</MOD_TYPE>
      <SAPNOTE_NUM>0000000000</SAPNOTE_NUM>
      <SAPMSG_NUM>0000000000</SAPMSG_NUM>
      <TECH_SCRIPT>TS-2498 Pricing Routines</TECH_SCRIPT>
      <REASON>New pricing routines required</REASON>
      <DEV_ENV>ECC6</DEV_ENV>
      <INSTALL_NO>029</INSTALL_NO>
      <BASIS_REL>700</BASIS_REL>
      <REG_STATUS />
      <REJ_REASON />
      <APP_DATE />
      <REJ_DATE />
      <APPROVER />
      <REGISTRATOR />
      <REG_DATE />
      </REQ_HDR>
    <KEY_DETAILS>
    <DATA>
      <MANDT />
      <REQ_NUM />
      <PGMID>R3TR</PGMID>
      <OBJECT>PROG</OBJECT>
      <OBJ_NAME>RVGHT902</OBJ_NAME>
      <ACCESSKEY />
      </DATA>
    <DATA>
      <MANDT />
      <REQ_NUM />
      <PGMID>R3TR</PGMID>
      <OBJECT>PROG</OBJECT>
      <OBJ_NAME>RVGHT901</OBJ_NAME>
      <ACCESSKEY />
      </DATA>
      </KEY_DETAILS>
      </PIM_REQUEST>
      </data>
    [/code]
    This maps directly to 1 dictionary structure that exists within our system containing all of the same components. PIM_REQUEST has a corresponding SAP dictionary structure Y_REQUEST_HDR which is a deep structure and has within it a structure REQ_HDR and a table KEY_DETAILS.
    The corresponding simple transformation we have then used is as follws:
    [code]
    <?sap.transform simple?>
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
      <tt:root name="root"/>
      <tt:template>
        <data>
          <PIM_REQUEST>
            <tt:copy ref="root"/>
          </PIM_REQUEST>
        </data>
      </tt:template>
    </tt:transform>
    [/code]
    Alternatively the following 2 options also work:
    Option 2:
    [code]
    <?sap.transform simple?>
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
      <tt:root name="root"/>
      <tt:template>
        <data>
          <PIM_REQUEST>
            <REQ_HDR>
              <tt:copy ref="root.REQ_HDR"/>
            </REQ_HDR>
            <KEY_DETAILS>
              <tt:loop name="KEY_DETAILS" ref="root.KEY_DETAILS">
                <DATA>
                  <tt:copy ref="$KEY_DETAILS"/>
                </DATA>
              </tt:loop>
            </KEY_DETAILS>
          </PIM_REQUEST>
        </data>
      </tt:template>
    </tt:transform>
    [/code]
    Option 3:
    [code]
    <?sap.transform simple?>
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
      <tt:root name="root"/>
      <tt:template>
        <data>
          <PIM_REQUEST>
            <REQ_HDR>
              <MANDT tt:value-ref="root.REQ_HDR.MANDT"/>
              <REQ_NUM tt:value-ref="root.REQ_HDR.REQ_NUM"/>
              <REQ_DESC tt:value-ref="root.REQ_HDR.REQ_DESC"/>
              <PROC_AREA tt:value-ref="root.REQ_HDR.PROC_AREA"/>
              <REQUESTED tt:value-ref="root.REQ_HDR.REQUESTED"/>
              <REQUIRED tt:value-ref="root.REQ_HDR.REQUIRED"/>
              <REQUESTOR tt:value-ref="root.REQ_HDR.REQUESTOR"/>
              <MOD_TYPE tt:value-ref="root.REQ_HDR.MOD_TYPE"/>
              <SAPNOTE_NUM tt:value-ref="root.REQ_HDR.SAPNOTE_NUM"/>
              <SAPMSG_NUM tt:value-ref="root.REQ_HDR.SAPMSG_NUM"/>
              <TECH_SCRIPT tt:value-ref="root.REQ_HDR.TECH_SCRIPT"/>
              <REASON tt:value-ref="root.REQ_HDR.REASON"/>
              <DEV_ENV tt:value-ref="root.REQ_HDR.DEV_ENV"/>
              <INSTALL_NO tt:value-ref="root.REQ_HDR.INSTALL_NO"/>
              <BASIS_REL tt:value-ref="root.REQ_HDR.BASIS_REL"/>
              <REG_STATUS tt:value-ref="root.REQ_HDR.REG_STATUS"/>
              <REJ_REASON tt:value-ref="root.REQ_HDR.REJ_REASON"/>
              <APP_DATE tt:value-ref="root.REQ_HDR.APP_DATE"/>
              <REJ_DATE tt:value-ref="root.REQ_HDR.REJ_DATE"/>
              <APPROVER tt:value-ref="root.REQ_HDR.APPROVER"/>
              <REGISTRATOR tt:value-ref="root.REQ_HDR.REGISTRATOR"/>
              <REG_DATE tt:value-ref="root.REQ_HDR.REG_DATE"/>
            </REQ_HDR>
            <KEY_DETAILS>
              <tt:loop ref="root.KEY_DETAILS" name="KEY_DETAILS">
                <DATA>
                  <MANDT tt:value-ref="$KEY_DETAILS.MANDT"/>
                  <REQ_NUM tt:value-ref="$KEY_DETAILS.REQ_NUM"/>
                  <PGMID tt:value-ref="$KEY_DETAILS.PGMID"/>
                  <OBJECT tt:value-ref="$KEY_DETAILS.OBJECT"/>
                  <OBJ_NAME tt:value-ref="$KEY_DETAILS.OBJ_NAME"/>
                  <ACCESSKEY tt:value-ref="$KEY_DETAILS.ACCESSKEY"/>
                </DATA>
              </tt:loop>
            </KEY_DETAILS>
          </PIM_REQUEST>
        </data>
      </tt:template>
    </tt:transform>
    [/code]

  • Problem in transforming xml to html using xsl

    Hi everybody ,
    I am creating a xml in memory and i want to transform using xsl into an html.
    I want to embed some html code also in the data node.But when I get the html it simply writes as it is. I tried to make it cdata section but it did not worked. Pls help.
    crypticashu
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.transform.dom.DOMSource;
    import org.w3c.dom.*;
    import javax.xml.transform.*;
    import javax.xml.transform.stream.*;
    public class mytemp {
         public static void main(String args[])
         DocumentBuilder builder = null;
         Document document = null;
         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
         try
         builder = factory.newDocumentBuilder();
         document = builder.newDocument();
         catch (ParserConfigurationException e)
         e.printStackTrace();
         Element root = (Element) document.createElement("REPORT");
         document.appendChild(root);
         Node child = document.createElement("DATA");
         CDATASection data = document.createCDATASection("<b>Hello World </b>");
         child.appendChild(data);
         root.appendChild(child);
         document.getDocumentElement().normalize();
         DOMSource domsource = new DOMSource(document);
              TransformerFactory tfactory = TransformerFactory.newInstance();
              File f = new File("c:/mytemp/report.xsl");
              StreamSource xsl = new StreamSource(f);
              File html = new File("c:/myhtml.html");
              try
                   Templates templates = tfactory.newTemplates(xsl);
                   Transformer transformer = templates.newTransformer();
                   transformer.transform(domsource, new StreamResult(html));
              catch(Exception e)
                   e.printStackTrace();
         }

    want to embed some html code also in the data node.But when I get the html it simply writes as it is.That statement contradicts:
    In real application i will be getting data containg html tags.I want the parser to read that data as simple text. Both cannot be true. You either want the HTML to not be parsed or you want the transformer to deal with it. Which one?
    - Saish

Maybe you are looking for

  • Problem with MSI Board and MSI Geforce 4 with Windows XP

    I have a MSI 845E Max(MS-6566E)               MSI Geforce 4 - 420               Celeron 1.7 gig               Soundblaster Live               2 Network Cards               and the usual stuff. I have loaded Windows 98 on my system and it works fine.

  • How do I combine two regents into one in Logic Pro Arrange?

    how do I combine two regents into one in Logic Pro Arrange?

  • Calling an SP takes over 200% more time over the select statement

    As part of my POC converting a SQL Server application over to SAP HANA, I'm find that CALL is taking over 200% more time than calling the SELECT statement directly. The result is that the application that uses ODBC against HANA with CALL statements i

  • How to adjust the column size

    Hi All, I have a table UI element and due to length of header my column is expanded in width.  Kindly assist how I can adjust the column length so the look and feel is good.  I am using NWDS 7.0 sp 05. Thank you Regards, Jaspreet Kaur Grewal

  • OT: gigabit Network card on linux

    First sorry: Totally off topic. This is a total long shot - but I dont suppose any one round here has got a Netgear GA311 working on lunux (Fedora core 3)?