Html tag as xml tag value?

Hi,
Can I put a html tag as value to a xml tag? something like this
<abc>
<username>Uma</username>
      <displayTag>
              <start><h1></start>
              <end></h1></end>
      </displayTag>
</abc>Please help.
Thanks in advance.

You can either use > and < for < and > to get something that appears to be an html tag, or you can use a CDATA section.
It partly depends on what you plan to do with that content.
Dave Patterson

Similar Messages

  • HTML encoding of XML tags

    Hi ,
    I am using openSAML and passing an XML document as a string to the SAMLAttribute.
    But when i see in the logs, the XML tags like "<" , ">" are being displayed as &lt and &gt. I don't want this HTML encoding to happen ... I don't know why this is happening ?
    Please advise. Yours help is greatly appreciated.
    Thanks in advance.

    I'm not sure but I think you need to have double quotes.
    ""<"" "">""
    sandyR

  • How use forEach tag in xml tag library

    Hi,
    Can u please explain the procedure for using forEach tag for displaying the parsed xml tags?
    This is the code snippet
    <%@ page contentType="text/html" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml" %>
    <html>
    <body>
         <c:import url="\books.xml" var="url" />
         <x:parse xml="${url}" var="doc" />
              <x:forEach var="n" select="${doc}/books/book">
                   <x:out select="${n}/title"/>
                   <x:out select="${n}/author" />
         </x:forEach>
    </body>
    </html>
    but I got the fallowing error.
    java.lang.NoClassDefFoundError: org/saxpath/SAXPathException
         at org.apache.taglibs.standard.tag.common.xml.ForEachTag.prepare(ForEachTag.java:51)
         at javax.servlet.jsp.jstl.core.LoopTagSupport.doStartTag(LoopTagSupport.java:262)
         at jsp_servlet.__index._jspService(__index.java:197)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

    Just the same way as you do in JSP. Since JSF 1.2 you can use unified EL #{ } in c:forEach.
    You can also use Tomahawk's [t:dataList|http://myfaces.apache.org/tomahawk-project/tomahawk12/tagdoc/t_dataList.html] by the way. It is more efficient.

  • Insert HTML Page into XML CDATA Tag

    Hi Guy
    I have a very big problem.
    I create a little web site and I use XSL + XML to produce output.Now I
    want to add a part of html page into xml tag to use a custom page section.
    But i find a problme,
    see the example :
    I use this xml :
    <resources>
    <html><![CDATA[<B>Hello World</B>]]></html>
    </resources>
    trasform xml with xsl page
    and my output into html browser is (&lt);B(&gt);Hello World(&lt);/B(&gt);(please remove the bracket( ) while reading the text to understand my problem)
    my BOLD html tag is not parse by browser because xslt parser trasform
    my special tag into other tag.
    I want output like this:
    <b>Hello World</b>
    But it's coming like (&lt);B(&gt);Hello World(&lt);/B(&gt); (please remove the bracket( ) while reading the text to understand my problem)
    Can you help me ?
    this is my trasformation function :
    private Transformer getXSLTransformer (xslFile) throws
    XSLTransformerConfigurationException {
    try {
    Transformer transformer = null;
    tFactory = TransformerFactory.newInstance();
    transformer = tFactory.newTransformer(new
    StreamSource(xslFile)); // load xslFile from disk
    } catch (TransformerConfigurationException tce) {
    throw new XSLTransformerConfigurationException(tce.getMessage());
    return transformer;
    public String myTrasform(String xml,String xslFile) throws Exception {
    StringWriter outputString = new StringWriter(512);
    Transformer transformer = getXSLTransformer (xslFile);
    transformer.transform(new StreamSource(new StringReader(xml)), new
    StreamResult(outputString));
    return outputString.toString();
    Thank's in advance.
    kuruvi
    Edited by: Mc_Kuruvi on Jun 14, 2009 3:47 AM

    Read:
    Oracle® XML DB
    Developer's Guide
    10g Release 1 (10.1)
    Part No. B10790-01
    December 2003
    1. "Do I use sqlloader and what datatype?"
    Use XMLType
    2. "I have embedded graphics so do the images get stored separately or does the entire page get stored as a BLOB datatype?"
    Page 827:
    The Oracle XML DB native datatype XMLType helps store and manipulate XML. Multiple storage options (Character Large Object (CLOB) or structured XML) are available with XMLType, and administrators can choose a storage that meets their requirements. CLOB storage is an un-decomposed storage that is like an image of the original XML.

  • How to Include html tag in xml

    Hi,
    Is there any way to include html tags in xml?
    For Example, I'm using xsl to get the value of FIELD_1 from fetch.xml
    In fetch.xml, I have the tag
    <FIELD_1>
    <font color='#8080ff'>&#160;<font face='Times New Roman, Times' size='28'>Testing font and color</font></font>
    </FIELD_1>
    But If I tried to read the value from xsl like <xsl:value-of select="FIELD_1"/> I'm just gettig the display 'Testing font and color' without the specified font and color....
    How to achieve this?
    Thanks
    Selva.

    Hi,
    Thanks for the input.
    I tried with the below code
    <fo:block space-after="5mm" font-family="Arial"><xsl:copy-of select="FIELD_1"/></fo:block>
    But I'm getting the below error...
    "An invalid XML character (Unicode: 0xa0) was found in the element content of the document."
    Below is the code included in the xsl....
    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <xsl:output method="xml" indent="yes"/>
    <xsl:template match="Values"><fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <fo:layout-master-set>
    <fo:simple-page-master master-name="simpleA4" page-height="29.7cm" page-width="21cm" margin-top="3cm" margin-bottom="2cm" margin-left="2cm" margin-right="2cm">
    <fo:region-body/>
    </fo:simple-page-master>
    </fo:layout-master-set>
    <fo:page-sequence master-reference="simpleA4">
    <fo:flow flow-name="xsl-region-body">
    <fo:block space-after="5mm" font-family="Arial"><xsl:copy-of select="FIELD_1"/></fo:block>
    </fo:flow> </fo:page-sequence> </fo:root> </xsl:template></xsl:stylesheet>
    Is there any mistakes in the above code?
    Regards,
    Selva.

  • Embedding inline HTML data in XML using the mx:XML tag with &lt; and &gt;

    What is best practice for embedding HTML within the
    <mx:XML> tag? Programmatically, I can implement this
    successfully:
    [Bindable]
    public var xmlDP:XML = <component data="&lt;" />;
    However, I get the following error if I try to store the same
    data inline in an mx:XML tag, as such:
    <mx:XML id="xmlDP">
    <component data="&lt;" />
    </mx:XML>
    Error #1095: XML parser failure: Unterminated attribute.
    If I change the MXML tag as follows, it works fine:
    <mx:XML id="xmlDP">
    <component data="&amp;lt;" />
    </mx:XML>
    Unfortunately, I also can not source the mx:XML tag to an XML
    file which uses &lt; or &gt; codes, as it yields the same
    results. This leads me to believe that the <mx:XML> tag does
    not support the special character codes for < and >, but why?
    Incidentally, this code also gives a 1095 error:
    <mx:XML id="xmlDP">
    <component data="&#0060;" />
    </mx:XML>
    This is causing an issue with my source data as it is not
    hand typed into Flex, and standard XML supports the &lt; and
    &gt; codes. I have tried a full HTML string, as shown below,
    but this also generates the error:
    <mx:XML id="xmlDP">
    <component data="&lt;b&gt;Test&lt;/b&gt;"
    />
    </mx:XML>
    Many thanks for any input you may have!

    I’m generating the XML source file with
    Microsoft’s XML Notepad 2007. It will encode invalid special
    characters automatically. My understanding is that this is the
    proper way to handle the less than symbol in a XML string, that is
    to say using the &lt; code.
    With respect to the escape and un-escape methods, I am able
    to successfully implement these in AS, but not in MXML. This makes
    sense considering they are AS methods, but I was hoping to be able
    to do something like:
    <mx:XML id="xmlDP">
    <component data="escape('<');" />
    </mx:XML>
    This gives the following compilation error:
    The value of attribute "data" must not contain the '<'
    character.
    As does using the escape character as such:
    <mx:XML id="xmlDP">
    <component data="\<" />
    </mx:XML>
    Below is an example of what the escape character may be used
    for in AS:
    var myString:String = "\"";
    trace(myString);
    // result: "
    Likewise, I can escape the < character as such:
    var myString:String = escape("<");
    trace(myString);
    // result: %3C
    <mx:XML id="xmlDP">
    <component data="%3C" />
    </mx:XML>
    trace(un-escape(xmlDP.@data));
    // result: <
    As you can see, using %3C and unescaping in AS will yield the
    correct result; however, this is not a practical method of
    representing the data in MXML as I would have to write an AS method
    to un-escape the XML string anyway, so I might as well just store
    the data in AS to begin with. I was hoping for a way to source an
    mx:XML object, without having to load it into ActionScript
    manually. Here’s an example of the functionality I would
    expect:
    <mx:XML id="xmlDP">
    <component data="&gt;" />
    </mx:XML>
    trace(xmlDP.@data);
    // result: >
    Only this does not work for the less than symbol. I’m
    assuming at this point that this is a bug in the Flex compiler.
    Thanks again for your help troubleshooting this one!

  • HTML Tags in XML Update

    I have a unique situation (may be not that unique). I want to update or add HTML tags in an XML element I am writing a PL/SQL Stored Procedure to insert, update or delete elements/attributes from an XML Type column based on the input XML (coming from Java application). SP is called from Java app. For example my XML may loook like
    <Description Name="Sales Message">
    <Text>This is a test</Text>
    </Description>
    I can update this in XML by creatinga SP which accepts a value (clob or text) and make a simple update call like
    UPDATE table_name
    SET hotel_xml = UPDATEXML (hotel_xml, Description[@Name=''Sales Message'']/Text/text()', 'This is a Test')
    WHERE id = 123;
    Hopwever when I have HTML tags in my parameter value, my update fails. For example java pp passes me a string
    This is a bold &lt;B&gt;Test&lt;/B&gt;
    (without encoding it is "This is a Bold <B>Test</B>"
    When I run this
    UPDATE table_name
    SET hotel_xml = UPDATEXML (hotel_xml, Description[@Name=''Sales Message'']/Text/text()', 'This is a bold &lt;B&gt;Test&lt;/B&gt;')
    WHERE id = 123;
    It thinks, I am passing a substitution variable (think &lt and &gt as sub variables) and the procedure fails.
    How do I handle HTML encoded charcters in Oarcle Pl/SQL? Many of my SPs has to accept XML as clob that may contain HTML encoding. Java always encodes HTML tags in an XML so I have to pass the CLOB(xml) to a SP as it is

    When this type of encoding is there in my XML or input variable, PL/SQL thinks
    its a substitution variable and tries to replace it by prompting replacement. I think »substitution variables« is the wrong phrase for this. Probably you mean »entity names«, and all that happens is that special characters are converted to »entity names« to ensure valid xml after the update:
    SQL> with table_name as (
    select xmltype('<Description Name="Sales Message">
                       <Text>This is a test</Text>
                     </Description>') hotel_xml from dual)
    select updatexml (hotel_xml,
                      'Description[@Name="Sales Message"]/Text/text()',
                      'This is a bold <B>Test</B>'
                     ) hotel_xml
      from table_name
    HOTEL_XML                                                                                             
    <Description Name="Sales Message"><Text>This is a bold &amp;lt;B&amp;gt;Test&amp;lt;/B&amp;gt;</Text></Description> Do you expect your result to look like
    <Description Name="Sales Message">
      <Text>This is a bold <B>Test</B></Text>
    </Description>??

  • Need help in extracting value from an xml tag.

    Hi ALL,
    Good Morning to all, i have problem in fetching a value from a xml tag. I have created a xml schema based on the schema i have created a xmltype table and inserted a value to the table. When i am trying to fetch a value from a particular tag i am unable to do so.. Kindly help me to solve this. Here by i am posting all the workings i have done...
    I am using the following client:
    SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jan 31 11:44:59 2011
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    ////////////////////////////////// XML Schema ///////////////////////
    begin
    dbms_xmlschema.registerSchema(
    'http://www.oradev.com/chipsxml.xsd',
    '<schema xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.oradev.com/chipsxml.xsd"
    xmlns:samp="http://www.oradev.com/chipsxml.xsd"
    version="1.0">
    <element name="Field1">
    <complexType>
    <sequence>
         <element name="UTI">
              <complexType>
              <sequence>
              <element name = "U01" type = "string"/>
              <element name = "U02" type = "string"/>
              <element name = "U03" type = "string"/>
              <element name = "U03a" type = "string"/>
              <element name = "U03b" type = "string"/>          
              <element name = "U03c" type = "string"/>          
              <element name = "U04" type = "string"/>                    
              <element name = "U05" type = "string"/>                    
              </sequence>
              </complexType>
         </element>
    </sequence>
    </complexType>
    </element>
    </schema>',
    TRUE, TRUE, FALSE, FALSE);
    end;
    ////////////////////////// Table which has multiple Column //////////////////////////
    CREATE TABLE chipsxmltable1 (
    id number, XMLDATA XmlType)
    XMLTYPE XMLDATA STORE AS OBJECT RELATIONAL
    XMLSCHEMA "http://www.oradev.com/chipsxml.xsd"
    ELEMENT "Field1";
    ///////////////////////////////// Insert Query in chipsxmltable //////////////////////////
    INSERT INTO chipsxmltable VALUES(
    xmltype.createxml('<?xml version="1.0"?>
    <samp:Field1 xmlns:samp="http://www.oradev.com/chipsxml.xsd" >
    <UTI>
    <U01>No</U01>
    <U02>Y</U02>
    <U03>Y</U03>
    <U03a>Y</U03a>
    <U03b>Y</U03b>
    <U03c>Y</U03c>     
    <U04>Y</U04>
    <U05>Y</U05>          
    </UTI>
    </samp:Field1>'));
    To show the data as a field with structure:
    1. Query:
    Select * from chipsxmltable1;
    Output:
    ID XMLDATA
    1 <?xml version="1.0"?>
    <samp:Field1 xmlns:samp="http://www.oradev.com/chipsxml.xsd">
    <UTI>
    <U01>No</U01>
    <U02>No</U02>
    <U03>Y</U03>
    <U03a>Y</U03a>
    <U03b>Y</U03b>
    <U03c>Y</U03c>
    <U04>Y</U04>
    <U05>Y</U05>
    </UTI>
    </samp:Field1>
    2. Query: (Both the query displays the same Output)
         SELECT X.xmldata.getClobVal() "XMLDATA" FROM chipsxmltable1 X;
         select extract(XMLDATA, '/Field1').getstringval() "XMLDATA" from chipsxmltable1 x;
    Output:
    XMLDATA
    <?xml version="1.0"?>
    <samp:Field1 xmlns:samp="http://www.oradev.com/chipsxml.xsd">
    <UTI>
    <U01>No</U01>
    <U02>No</U02>
    <U03>Y</U03>
    <U03a>Y</U03a>
    <U03b>Y</U03b>
    <U03c>Y</U03c>
    <U04>Y</U04>
    <U05>Y</U05>
    </UTI>
    </samp:Field1>
    To show the data as a single string without structure using "getstringval()":
    3. Query
         select extract(XMLDATA, '//text()').getstringval() "CHIPS - XML" from chipsxmltable1 x;
    OUtput:
    CHIPS - XML
    NoNoYYYYYY
    To show the data as a single string without structure using "getclobval()":
    4.Query
         select extract(XMLDATA, '//text()').getClobVal() "CHIPS - XML" from chipsxmltable1 x;
    Output:
    CHIPS - XML
    NoNoYYYYYY
    To show the data in a particular tag with/Without structure (Which is not working) using "EXTRACT" function:
    6.Query:
         select extract(XMLDATA, '/Field1/text()').getstringval() "XMLDATA" from chipsxmltable1 x;
         select extract(XMLDATA, '/Field1/UTI').getstringval() "XMLDATA" from chipsxmltable1 x;
         select extract(XMLDATA, '/Field1/UTI/U01').getstringval() "XMLDATA" from chipsxmltable1 x;
         select extract(XMLDATA, '/Field1/UTI/U01/text()').getstringval() "XMLDATA" from chipsxmltable1 x;
    Output:
    CHIPS - XML
    The above queries are not fetching the value.
    To show the data in a particular tag with/Without structure (Which is not working) using "EXTRACTVALUE" function:
    7. Query:
         select extractValue(XMLDATA, '/Field1/UTI') "XMLDATA" from chipsxmltable1 x;
         select extractValue(XMLDATA, '/Field1/UTI/U01') "XMLDATA" from chipsxmltable1 x;
    Output:
    X
    The above queries are not fetching the value.
    My question is:
    How to fetch values from xml tag when the value are inserted through xml schema?
    Apologies if the description is not clear. Kindly let me know if further details are needed. Many thanks for your help.
    Very best regards,
    Godwin Jebakumar C.V.

    Hi,
    You need to declare the namespace of each element used in the XPath expression, like this :
    SQL> select extractvalue( XMLDATA
      2                     , '/samp:Field1/UTI/U01'
      3                     , 'xmlns:samp="http://www.oradev.com/chipsxml.xsd"' ) "XMLDATA"
      4  from chipsxmltable1 x
      5  ;
    XMLDATA
    No
    SQL> select extract( XMLDATA
      2                , '/samp:Field1/UTI'
      3                , 'xmlns:samp="http://www.oradev.com/chipsxml.xsd"'
      4                ).getstringval() "XMLDATA"
      5  from chipsxmltable1 x
      6  ;
    XMLDATA
    <UTI>
      <U01>No</U01>
      <U02>Y</U02>
      <U03>Y</U03>
      <U03a>Y</U03a>
      <U03b>Y</U03b>
      <U03c>Y</U03c>
      <U04>Y</U04>
      <U05>Y</U05>
    </UTI>
    Please see EXTRACT and EXTRACTVALUE documentation :
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions051.htm#i1006712
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions052.htm#SQLRF06173
    BTW, "XMLDATA" is a pseudo-column used by Oracle. I don't know if it'll ever cause any conflict but maybe you should rename your column.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/pseudocolumns010.htm#SQLRF00256
    Regards.

  • How to get the XML TAG name itself instead of TAG value

    Hi All,
    I have a question here
    I want to retrieve the XML tag from a XML file instead of its value.
    Example:
    <item>Colgate</item>
    Now I want to retrieve "item" as output from XPath expression, I dont want its value as "colgate"
    How to do that...?
    Thanks
    -Praveen

    You can do this with an axes XPatch expression:
    child::node()/name()
    For more info see: http://www.w3schools.com/xpath/xpath_axes.asp
    HTH,
    Bas

  • Text Box issue - displays XML tag instead of the value in EBS

    I need to use a textbox (or a autoshape with text) to place a data element in a specific position on the page in an RTF template. I tried using tables and it didn't help. This layout needs some elements to be placed at specific location and using an autoshape or a text box is easy. When I preview the pdf output on my desktop, it works fine. Once I upload the template into EBS XML Publisher, the value in the text box shows up as an XML Tag instead of the value in that tag. The same XML data when loaded and previewed locally shows the data instead of the tag.
    Any thoughts on this? Is there a patch or something we might need for this in EBS?
    Thanks,
    Vinay

    Thanks Tim for the quick response.
    Yes - the versions are same. Also, I tried giving the complete path. The issue is that it is not even reading the text in the text box as an XML tag. It seems to think the whole text box is an object and hence just display that text as is. If it was reading and not able to resolve it, I guess it would have displayed blank (and not the tag as is). Again as I mentioned it works fine in local preview on my machine.

  • Getting unwanted values between the XML tags in XSLT mapping

    Hi Folks
    I have come across a very strange situation with my xslt mapping.
    I am getting unwated values "11" between xml tags
    as follows
    <Tag>0001</Tag>
    11
    <DataID>3</DataID>
    I am not sure why I am getting these values in between the tags. Any suggestions would be appreciated.

    Hi David,
    Here is the code fragment where these 2 tags are mapped, FYI, the source is an IDOC message. The unwanted "11" is coming After the <Tag></Tag> and <DataID></DataID>. FYI, Fof the element <Tag></Tag> its a default value. But for <DataID> </DataID>  I have the mapping logic.
    <Order>
                <OrderHeader>
                  <Tag>009</Tag>
                  <xsl:for-each select="E1EDKA1">
                    <xsl:choose>
                      <xsl:when test="normalize-space(PARVW) = 'WE' and normalize-space(LIFNR) = 'U960'">
       <DataID>
                        <xsl:value-of select="'1'" />
       </DataID>
                      </xsl:when>
                      <xsl:when test="normalize-space(PARVW) = 'WE' and normalize-space(LIFNR) = 'U300'">
       <DataID>
                        <xsl:value-of select="'3'" />
           </DataID>
                      </xsl:when>
       <xsl:when test="normalize-space(PARVW) = 'WE' and normalize-space(LIFNR) = 'U930'">
       <DataID>
                        <xsl:value-of select="'1'" />
       </DataID>
                      </xsl:when>
       <xsl:when test="normalize-space(PARVW) = 'WE' and normalize-space(LIFNR) = 'U400'">
       <DataID>
                        <xsl:value-of select="'3'" />
       </DataID>
                      </xsl:when>
                      <xsl:otherwise>
                        <xsl:value-of select="'1'" />
                      </xsl:otherwise>
                    </xsl:choose>
                   </xsl:for-each>

  • How to filter particular xml tag value using -DBMS_XMLGEN / DBMS_XMLSTORE

    Hi,
    I am using dbms_xmlgen and dbms_xmlstore package to extract xml datafile tag value from file server to oracle database table.
    I have used the below pl/sql program to extract the xml tag values to oracle relational table.Its working fine for me.
    But I would like to extract the values based on particular filter condition.
    The following xml program I have 3 rows I would like extract the xml data based on the following condition .
    Filter condition
    ==============
    the tag <STATE_ABBREVIATION> value shuold be 'CA' and the <CITY> tag value should be Palo_Alto then I will store the ZIPCODE
    ZIP_CODE_EXTN,STATE_ABBREVIATION tag values in the Oracle Relational table.
    The below pl/sql program storing all the three rows but I required the values based on the filter condition that I mentioned earlier.
    Kindly assist me what are the steps that I need to change in this program.?
    XML Program file content.
    ======================
    <ZIPCODES>
    <mappings>
    <STATE_ABBREVIATION>CA</STATE_ABBREVIATION>
    <ZIPCODE>94301</ZIPCODE>
    <ZIP_CODE_EXTN>9277</ZIP_CODE_EXTN>
    <CITY>Palo_Alto</CITY>
    </mappings>
    <mappings>
    <STATE_ABBREVIATION>CA</STATE_ABBREVIATION>
    <ZIPCODE>95302</ZIPCODE>
    <ZIP_CODE_EXTN>9279</ZIP_CODE_EXTN>
    <CITY>LA</CITY>
    </mappings>
    <mappings>
    <STATE_ABBREVIATION>TX</STATE_ABBREVIATION>
    <ZIPCODE>75038</ZIPCODE>
    <ZIP_CODE_EXTN>7837</ZIP_CODE_EXTN>
    <CITY>DALLAS</CITY>
    </mappings>
    </ZIPCODES>
    PL/SQL Program for XML extract.
    ==========
    declare
    charString varchar2(80);
    finalStr varchar2(4000) := null;
    rowsp number;
    insCtx DBMS_XMLStore.ctxType;
    ctx dbms_xmlgen.ctxHandle;
    v_FileHandle UTL_FILE.FILE_TYPE;
    begin
    v_FileHandle := utl_file.fopen('XMLTEST','XML_NEW_CITIES.XML','r') ;
    loop
    BEGIN
    utl_file.get_line(v_FileHandle, charString);
    exception
    when no_data_found then
    utl_file.fclose(v_FileHandle);
    exit;
    END;
    dbms_output.put_line(charString);
    if finalStr is not null then
    finalStr := finalStr || charString;
    else
    finalStr := charString;
    end if;
    end loop;
    insCtx := DBMS_XMLStore.newContext('SYS.ZIPCODES');
    dbms_xmlgen.setRowsetTag(insCtx,'ZIPCODES');
    dbms_xmlgen.setRowsetTag(insCtx,'mappings');
    DBMS_XMLStore.clearUpdateColumnList(insCtx);
    DBMS_XMLStore.setUpdateColumn(insCtx,'ZIPCODE');
    DBMS_XMLStore.setUpdateColumn(insCtx,'ZIP_CODE_EXT N');
    DBMS_XMLStore.setUpdateColumn(insCtx,'STATE_ABBREV IATION');
    rowsp := dbms_xmlstore.insertXML(insCtx,finalstr);
    end;
    Thanks,
    nat

    Thanks for your reply. :)
    Its working fine in the DBMS_XMLSTORE package. Here I have given the code
    CREATE OR REPLACE TYPE typ_dummy AS  OBJECT
    ( "@ENO"   NUMBER,
      "@ENAME" VARCHAR2(100),
      eno      NUMBER,
      ename    VARCHAR2(100));
    CREATE TABLE EMP
      empno    VARCHAR2(25),
      sal      NUMBER,
      hiredate DATE,
      typ      TYP_DUMMY
    DECLARE
      insCtx DBMS_XMLStore.ctxType;
      rows NUMBER;
      xmldoc CLOB :=
        '<ROWSET>
           <ROW num="1">
             <SAL>1800</SAL>
             <EMPNO>739</EMPNO>
             <HIREDATE>27-AUG-1996</HIREDATE>
               <TYP ENO="739" ENAME="Nazurullah">
               <ENO> 1 </ENO>
               <ENAME> ALDRIN </ENAME>
               </TYP>
           </ROW>
           <ROW>
             <SAL>18000</SAL>
             <EMPNO>7369</EMPNO>
             <HIREDATE>27-AUG-1996</HIREDATE>
             <TYP ENO="7369" ENAME="PEPPIN" />
           </ROW>
           <ROW>
             <SAL>37000</SAL>
             <EMPNO>20701</EMPNO>
             <HIREDATE>27-AUG-1996</HIREDATE>
             <TYP>
               <ENO> 20701 </ENO>
               <ENAME> VENKATACHALAM </ENAME>
             </TYP>
           </ROW>
         </ROWSET>';
    BEGIN
      insCtx := DBMS_XMLStore.newContext('emp'); -- get saved context
      -- Now insert the doc.
      -- This will only insert into EMPNO, SAL and HIREDATE columns
      rows := DBMS_XMLStore.insertXML(insCtx, xmlDoc);
      -- Close the context
      DBMS_XMLStore.closeContext(insCtx);
    END;
    SELECT * FROM emp;
    EMPNO        SAL HIREDATE          TYP(@ENO, @ENAME, ENO, ENAME)
    739         1800 27-AUG-96     TYP_DUMMY(739, 'Nazurullah', 1, ' ALDRIN ')
    7369       18000 27-AUG-96     TYP_DUMMY(7369, 'PEPPIN', NULL, NULL)
    20701      37000 27-AUG-96     TYP_DUMMY(NULL, NULL, 20701, ' VENKATACHALAM ')

  • Extracting value from XML tags in Java

    Hi all,
    I need to extract the value from a string (XML Format). Eg. <Name>Ray</Name> and displaying Name: Ray
    The string value is like any other String class object except that it is format with XML tags. I have quite a few examples that shows how a value can be read from a .xml file but none that describe how to get a value from a String object.
    Thanks in advance.

                         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
         DocumentBuilder parser = factory.newDocumentBuilder();
         Document document = parser.parse("Your XML Goes here ");

  • Embedding html in xml tags, when rednering text as html

    Quick question,
    I have a site that reads all content from an external xml.
    The text box that reads this info renders the content as html; does
    anyone know how to go about putting an html tag in an xml tag so
    that flash can read it?
    So would it be possible to do:
    <content>
    " Welcome to the site<br>we are happy to have you
    here<br><img src="logo.jpg"> "
    </content>

    I completed deleted the old way, so I have to recreate this
    from scratch...but here is how I used to be able to do it (which,
    looking at how I do it now since HTML wasn't parsing, this was so
    stupid).
    <chair id="1" price_point="High-end">
    <image>&lt;a
    href='/dsn/catalog/viewproductpage.asp?OwnerID=1&amp;PageID=%7B7A0FB858%2D2184%2D4033%2DB 474%2D2B22D89BBD96%7D'&gt;&lt;img
    src='/images/s/dshe/mini/7/79219.jpg border='0'
    /&gt;&lt;/a&gt;</image>
    <description>&lt;a
    href='/dsn/catalog/viewproductpage.asp?OwnerID=1&amp;PageID=%7B7A0FB858%2D2184%2D4033%2DB 474%2D2B22D89BBD96%7D'&gt;Toni&lt;/a&gt;</description>
    <brand>Kwalu</brand>
    <composition>Kwalu</composition>
    <leg_style>Chippendale</leg_style>
    <overall_style>Transitional</overall_style>
    </chair>
    And now in 1.1, having that, it prints this on screen:
    <a
    href='/dsn/catalog/viewproductpage.asp?OwnerID=1&PageID=%7B7A0FB858%2D2184%2D4033%2DB474% 2D2B22D89BBD96%7D'><img
    src='/images/s/dshe/mini/7/79219.jpg border='0' /></a>
    whereas before, it would be that image and it would link to
    the page specified in the href.
    I'm about to take off from work for the night, but I'll check
    back when I get home if you need anything else from me.
    Thanks for your help, Kin. :)
    Kyle

  • How to get the value in the XML tag?

    hi all,
    i am new to JAXP. i tried the sample program provided in the following link. it just counts the number of tags in the XML file. XML file name is given as command line argument.
    Now, if i want to display the value in the XML tag( say <NAME>xxx</NAME> in this tag i want to display the value 'xxx' ), what has to be done?
    how can i achieve this?
    please help...
    link of the sample program:
    http://xml.apache.org/~edwingo/jaxp-ri-1.2.0-fcs/samples/SAXLocalNameCount/SAXLocalNameCount.java
    thx in advance,
    -Soni.

    implement this method the same way you have startElement...
    public void characters(char[] ch,
                           int start,
                           int length)
                    throws SAXException

Maybe you are looking for