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>??

Similar Messages

  • 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.

  • HTML tags in XML document

    I have an application that loads information from an XML file
    and displays in a dynamic text box. That works great. Now, I want
    to add HTML tags to the information in the XML file so the dynamic
    text box will format it. If I add straight html:
    <Answer1>of earth, <b>air</b>, fire, and
    water.</Answer1>
    I get a null displayed in the text box. If I encode
    <Answer1>of earth,
    &gt;b&lt;air&gt;/&lt;, fire, and
    water.</Answer1>
    Then it displays
    of earth, <b>air</b>, fire, and water.
    Any help on how to embedded html code into an XML document so
    a dynamic text box uses the html code?
    Thanks.

    Just use CDATA tags around your HTML values, eg:
    <Answer1><![CDATA[of earth, <b>air</b>,
    fire, and water.]]></Answer1>
    HTH.

  • Html tag in XML and spry

    Hi,
    I have HTML-element in XML doc, but i do not know how to get it out as HTML-element in PHP or in HTML.
    I have this kind of XML tag
    <logo><![CDATA[><a href="http://www.someadress.com"><img src="images/logos/companylogo.jpg" alt="Some Company"/></a>]]></logo>
    I use it in PHP page like this: <td>{logo}</td>
    I get it output in Browser as a String <a href="http://www.someadress.com"><img src="images/logos/companylogo.jpg" alt="Some Company"/></a>.. However I need it print out as an HTML-element not just a string
    Anybody knows how to solve this?
    Juha

    Hi Juha.
    Please have a look at the following.
    This is the XML file called info.xml:
    <?xml version="1.0" encoding="utf-8"?>
    <companies>
        <company>
            <name>Acme Pty Ltd</name>
            <address>23 Rue de Quebec</address>
            <city>Tinseltown</city>
            <website>http://www.acmeptyltd.com</website>
            <logo>logo_acme.jpg</logo>
        </company>
        <company>
            <name>Ajax Cor</name>
            <address>Amsterdamschestraat 203b</address>
            <city>Oranjestadt</city>
            <website>http://www.ajaxbros.com</website>
            <logo></logo>
        </company>
    </companies>
    This is the HTML-markup
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled</title>
    <style>
    .MasterDetail {
        font: 100% Verdana, Geneva, sans-serif;
        margin: 2px;
    .MasterDetail .MasterContainer {
        background-color: #EAEAEA;
        border: 1px solid gray;
        width: 35%;
        float: left;
        overflow: hidden;
    .MasterDetail .MasterColumn {
        font-size: 75%;
        background-color: #CCCCCC;
        padding:5px;
        cursor:pointer;
    .MasterDetail .MasterColumnHover {
        background-color: #EAEAEA;
    .MasterDetail .MasterColumnSelected {
        background-color:#848484;
        color: white;
    .MasterDetail .DetailContainer {
        border: 1px solid gray;
        padding:10px;
        width: 60%;
        float: right;
        overflow: auto;
    .MasterDetail .DetailColumn {
        margin-bottom: 1px;
    </style>
    <script src="SpryAssets/xpath.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryData.js" type="text/javascript"></script>
    <script type="text/javascript">
    <!--
    var ds1 = new Spry.Data.XMLDataSet("info.xml", "companies/company");
    //-->
    </script>
    </head>
    <body>
    <div class="MasterDetail">
      <div spry:region="ds1" class="MasterContainer">
        <div class="MasterColumn" spry:repeat="ds1" spry:setrow="ds1" spry:hover="MasterColumnHover" spry:select="MasterColumnSelected">{name}</div>
      </div>
      <div spry:detailregion="ds1" class="DetailContainer">
        <div class="DetailColumn" spry:if="'{logo}'"><a href="{website}"><img src="{logo}" alt="{name}"/></a></div>
        <div class="DetailColumn" spry:if="!'{logo}'">{name}</div>
        <div class="DetailColumn">{address}</div>
        <div class="DetailColumn">{city}</div>
      </div>
      <br style="clear:both" />
    </div>
    </body>
    </html>
    I hope this helps.
    Ben

  • HTML Tag in Xml

    Hi ,
             i want to render the xml data on my textfield. but it does not support  all the html text given by the " upcoming xml from server".so how to do that , because i want to display the same format of text as it showing on the server side using those Html tag.So waht approach i should follow to do this ,please help me...

    What is the text given by the " upcoming xml from server"?  What html elements are involved?

  • Using HTML tags in XML

    Trying to bring in an xml document that contains HTML tags but I can't seem to get it working.
    I have a bit of AS and a basic text field in a movie clip for now. I've pared it down as simply as I can to the following AS:
    var languageXML:XML = new XML();
    var nav:Array = new Array();
    languageXML.ignoreWhite = true;
    languageXML.load("code.xml");
    languageXML.onLoad = function(success) {
        var currentNavNode:XMLNode = this.firstChild.firstChild;
        var i:Number = 0;
        for (var childNode = currentNavNode; childNode != null; childNode=childNode.nextSibling, i++) {
            for (var stringNode:XMLNode = childNode.firstChild; stringNode != null; stringNode=stringNode.nextSibling, j++) {
                _root.feature0 = stringNode.firstChild.nodeValue
        //all the xml has now loaded so we're good to kick off the full nav
        _root.textWin.myText.html = true;
        _root.textWin.myText.htmlText = _root.feature0;
    Whilst my XML doc looks like this:
    <?xml version="1.0" encoding="utf-8"?>
    <feed>
    <item>
        <body><![CDATA[This<br>Should<br><br>Be fine.]]></body>
    </item>
    </feed>

    does trace(_root.textWin.myText+" "+_root.textWin.myText.multiline) show that you have a multline textfield?  if not, fix that.

  • 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

  • HTML tags inside XML

    I am using jsp to read a xml file and display it on the browser. Some of the elements of this xml file have html tags embedded inside them. Right now when I use a <x:out ...>, I get only the text from the element and the html tags get ignored. How do get the html tags to also work?
    example
    <ELEM1>
    For any questions <b>contact</B> us at e-mail
    <ELEM1>

    Set xslt output as html/text.
    <xsl:output method="html/text" />
    <xsl:copy-of select="ELEM1"/>

  • nbsp html tag in xml

    Hi
    I am using xsl file that takes a xml file as input and outputs another xml file.
    I need to read content from my input xml file which has the following code:
    Input Xml file content:
    *<body>text1</nbsp>text2</nbsp>text3</body>*
    My output xml file in reading body content is as below:
    text1text2text3
    but what i need is as follows:
    text1 text2 text3
    (spaces in between text1 and text2 is needed, but in my output </nbsp> tags are eliminated )
    Can any help me in this regard. how to do i get these spaces in my text?
    Thanks in advance.
    Menaga.

    I didn't know there was an element named <nbsp> in HTML. So maybe your browser is just ignoring it because it isn't an HTML element. But there is a character named   in HTML that's used for non-breaking space. To put that in an XML document you write it as &#160;.

  • Put html tag in xml genreted with strings panel

    Hello,
    I created an multilanguage application with the "strings
    "panel.
    My customer need to put some words in italic inside the
    dynamic textfield.
    So I used <i> tag or cdata tag insied the xml, but
    nothing works, even if I put the textfield in "html" format.
    So How can I do.
    Do we need to change the "locale.as" class?
    thanks.
    Regards,

    Is the dynamic text field set to embed the fonts? (Properties
    Panel >
    Character.... radio button clicked to specify ranges)
    If it is, set it to no characters. Also make sure your
    dynamic text field
    is set in the properties panel to render as html.
    Here is a test:
    Create a new Flash document, select the text tool from the
    tools menu and
    create a text area on the stage. Make it a dynamic text field
    in the
    properties panel and click the render as html button. Give it
    an instance
    name of "myText" and on frame one of the main timeline put
    the following
    actionscript.
    myText.htmlText = "<i> This is Italics</i>. This
    is not"
    Test the movie and it should show what you are looking for.
    Dan Mode
    --> Adobe Community Expert
    *Flash Helps*
    http://www.smithmediafusion.com/blog/?cat=11
    *THE online Radio*
    http://www.tornadostream.com
    *Must Read*
    http://www.smithmediafusion.com/blog
    "tof69" <[email protected]> wrote in message
    news:efb464$7cm$[email protected]..
    > Hello,
    > I created an multilanguage application with the "strings
    "panel.
    > My customer need to put some words in italic inside the
    dynamic textfield.
    > So I used
    tag or cdata tag insied the xml, but nothing works, even if
    > I
    > put the textfield in "html" format.
    > So How can I do.
    > Do we need to change the "locale.as" class?
    > thanks.
    > Regards,
    >
    >

  • New html tag highlight color

    Can someone tell me the name of the css selector that is the new html tag highlighting that Edge Code just released.  I need to adjust my theme css file because the new pale blue highlighting makes it difficult to read the tag (ie: divs, script, li, ul's, ect..). I assume it's new because it was not highlighting the html tags before I updated.

    I dont get an index.html link when I paste http://localhost:9235/ into chrome.  I just get a link to (/devtools/devtools.html?ws=localhost:9235/devtools/page/12c31149cd31cce235fc4998180602cd) which opens a blank html page with nothing inside the body tag.
    I changed the .cm-tag css property but that doesn't actually change the highlight color, it just changes the default non selected state. The tag in which I'm trying to overwrite has a hex code of #cfead6 which I can find no reference to in the program files or any theme css files. The image below is the highlight that occurrs when the cursor is inside the html tag.

  • XML with HTML Tags... (easy points) 11g question

    Dear Programming Gods,
    I have been researching this for about 2 weeks now, and I have hit the final road block.
    Using BI Publisher 11.1.1
    In APEX 4.0 I have a Rich Text Field. The data from the Rich Text Field is store in CLOB. The data has HTML formatting tags. I have a data model that selects the data. I create an xml which has the html tags. I export the xml and import it into MS Word using the BI Publisher add-in. I import my subtemplate which handles almost all of the formatting tags. I apply the template to the CLOB field so that the HTML formatting tags will be rendered when printed.
    The problem is this. The subtemplate is looking for this < and / > however BI publisher convters the tags stored in the CLOB from raw html tags to this &.lt; and &.gt; so the subtemplate can not match to it.
    Here is what I need to figure out and please explain it in very novice terms.
    When I generate and export the XML from BI Publisher how do I prevent it from converting my raw tags?
    Here is some further assistance when prepairing your answer.
    My subtemplate is based on the htmlmarkup.xsl from the following blog but has been modified heavily to include support for simple tables, more formatting such as subscripts and superscripts, ect...
    http://blogs.oracle.com/xmlpublisher/2007/01/formatting_html_with_templates.html
    I am also familliar with this blog but I do not understand how to implement it using BI 11g.
    http://blogs.oracle.com/xmlpublisher/2009/08/raw_data.html
    I have tried adding this to my layout but it doesnt seem to work.
    <xsl: element name="R_CLOB" dataType="xdo:xml" value="R_CLOB" / >
    Please, help me. I have to have this working in 4 days.
    Richard

    This did not work either. Here's more infor on what I have so far.
    My data template looks like this:
    <dataTemplate name="Data" description="Template">
         <parameters>
              <parameter name="p_person_id" dataType="character" defaultValue="1"/>
         </parameters>
         <dataQuery>
              <sqlStatement name="Q1">
                                  select TEMPORARY_TEMPLATE_DATA.line_id as LABEL_line_ID,
    TEMPORARY_TEMPLATE_DATA.column_id as LABEL_column_ID,
    TEMPORARY_TEMPLATE_DATA.person_id as LABEL_PERSON_ID,
    TEMPORARY_TEMPLATE_DATA.label as LABEL_DATA
    from MY_BIO.clm_TEMPORARY_TEMPLATE_DATA TEMPORARY_TEMPLATE_DATA
    Where person_id = :p_person_id
    and style = 'L'
                             </sqlStatement>
              <sqlStatement name="Q2" parentQuery="Q1" parentColumn="LABEL_DATA">
                                  select TEMPORARY_TEMPLATE_DATA.LINE_ID as LINE_ID,
    TEMPORARY_TEMPLATE_DATA.COLUMN_ID as COLUMN_ID,
    TEMPORARY_TEMPLATE_DATA.label as COLUMN_LABEL,
    to_nclob(TEMPORARY_TEMPLATE_DATA.COLUMN_DATA) as  COLUMN_DATA,
    TEMPORARY_TEMPLATE_DATA.STYLE as STYLE,
    TEMPORARY_TEMPLATE_DATA.ATTRIBUTE as ATTRIBUTE,
    NVL(TEMPORARY_TEMPLATE_DATA.JUSTIFY,'L') as JUSTIFY
    from MY_BIO.clm_TEMPORARY_TEMPLATE_DATA TEMPORARY_TEMPLATE_DATA
    Where person_id =:p_person_id
    and label = :LABEL_DATA
    and style != 'L'
    Order by line_id, column_id
                             </sqlStatement>
         </dataQuery>
         <dataStructure>
              <group name="G_LABEL" source="Q1">
                   <element name="LColumnData" value="label_data"/>
                   <group name="G_DATA" parentGroup="G_Label" source="Q2">
                        <element name="LineID" value="line_id"/>
                        <element name="ColumnID" value="column_id"/>
                        <element name="ColumnData" value="column_data"/>
                        <element name="Style" value="style"/>
                        <element name="Attribute" value="attribute"/>
                        <element name="Justify" value="justify"/>
                   </group>
              </group>
         </dataStructure>
    </dataTemplate>
    After running this data_template there was no change in the xml file generated see partial :  Note:
    my test actually has the B with the html tags
    </G_DATA>
    - <G_DATA>
    <LINEID>20</LINEID>
    <COLUMNID>1</COLUMNID>
    <COLUMNDATA>test test <B>my test</B></COLUMNDATA>
    <STYLE>R</STYLE>
    <ATTRIBUTE />
    <JUSTIFY>C</JUSTIFY>
    </G_DATA>
    - <G_DATA>
    <LINEID>21</LINEID>
    I loaded in to MS Word but there was no change documnet still look the same. I left the commands import file command and xsl:apply-templates command in the word document template.
    I really appreciate you helpiing me.
    cheryl

  • Parsing XML with html tags for style

    I'm using flash to pull in XML data, but I want to use html
    tags to be able to style the text. When I add any html, it treats
    it as a sub-node and ignores the data. Also, line breaks in the xml
    are being converted to double spaced paragraphs? The relevant code
    is basically this:
    if (element.nodeName.toUpperCase() == "TEXT")
    {//add text to text array
    ar_text[s]=element.firstChild.nodeValue;
    textbox1.text = ar_text[0];

    try to use htmlText instead text... like this:
    textbox1.htmlText = ar_text[0]
    adam

  • Including HTML tags in Spry XML data sets

    How does one add HTML tags to Spry XML data sets so that the displayed items include that markup?
    For example, I might want to bold-face words within XML data items. I have tried adding the markup, but instead of seeing, for example:
    This is bold face
    in the Spry table, I see:
    This is <b>bold</b> face
    I have tried using CDATA elements in the XML to no avail.

    Set the data type for the column as per
    var ds1 = new Spry.Data.XMLDataSet("myData.xml", "rows/row");
    ds1.setColumnType("myColumn", "html");
    Gramps

  • XML import = missing entities (common HTML tags)?

    I have a very simple XML doc, mostly text, but with common HTML tags (nbsp, for example).
    Upon import, I get an error for several of these tags - "Entity _____ was not found."
    These are common HTML characters - what can I do so that InDesign recognizes them? Do I have something set wrong? Do I have to map them?
    Thanks in advance...

    Nigel, this is completely unrelated to your post, so please excuse me interrupting but i'm not sure how else to go about it.
    I found a thread you initiated (via Google) which is no longer available in the forum here -- and Google only shows the first level of the thread's messages. All of this is to say, if you'd email me regarding it, i'd appreciate it. aaron (at) inis (dot) ie
    Here's the thread:
    http://209.85.141.104/search?q=cache:gAys1ctL840J:www.adobeforums.com/webx%3F14%40%40.3bc4 b495/6+indesign+grayscale+%22soft+proof%22&hl=en&ct=clnk&cd=2&gl=us
    Thanks!
    Aaron

Maybe you are looking for

  • Wifi connection fails after adding appletv.

    Wifi no longer works on iPhone 3GS, iPhone 4S, Epson Photo PX700W and Samsung PC after connecting my new Appletv. Any ideas why adding 1 device to my wireless network should cause 4 devices to longer connect. I can't even get the airplay icon on my i

  • Distorted video - too wide

    I have posted about this on Crackberry.com.  But maybe should bring it up here. The main problem is that when viewing a video on my Z10, images are stretched left to right and so people are wider than normal and also objects like buildings, etc also

  • Instructions on how to Use Tweeter With the iPad

    Having difficulty posting messages using the iPad.

  • Adobe Flash doesn´t start

    Hello, I have problem: I worked with Adobe Flash only problems. But last week, i want opend the programm, the Adobe Flash start-screen occurs, the evidencehttp://www.dict.cc/englisch-deutsch/evidence.html: fonts will be installed, and  one second lat

  • I want to read the attached file from the second line to the last line befor the first NCOUNT

    after i want put it in a array but just the 1.2.3.6.and the 7 column ex: TIMET 0 1 1 0 after to count how much NCOUNT i have and put the values of every one in long vector or array with one element Attachments: file2.txt ‏204 KB