Escaping of html characters
ahoj!
in an sql report i have to show text messages that include sometimes special html characters like <. is there an oracle function to convert this characters in the format & #60; (without the blank)? i don't want to replace all the special characters by myself.
thanks!
ciao,
christian
Edited by: Christian Ropposch on Apr 8, 2009 1:39 PM
Edited by: Christian Ropposch on Apr 8, 2009 1:40 PM
Hi Christian R.!
If I understood right then you are using APEX. HTP and HTF are included with Oracle and APEX. You don't need the Application Server.
regards
Similar Messages
-
How to get an xml string into a Document w/o escaping mark-up characters?
Hi,
I am using one of the latest xerces using Java. I am pretty sure I am using xerces-2.
I have an existing Document and I am trying to add more content to it. The new content itself is xml string. I am trying to insert this xml string into the document using document.createTextNode. I am able to insert, but somewhere it is escaping the mark-up characters (<,>,etc). When I convert the document into String, I can see, for example, <userData> instead of <userData>.
There is an alternative option to accomplish this by creating a new document with this xml string, get the root element, import this element into my document. Execution time for this procedure is very high - means, this is very bad in terms of time-wise performance.
Can any help on how to accomplish this (bringing an xml string into a document without escaping mark-up characters) in time-efficient way.So you want to treat the contents of the string as XML rather than as text? Then you have to parse it.
Or if your reason for asking is just that you don't like the look of escaped text, then use a CDATA section to contain the text. -
Hi,
I encountered a problem with regards to the display of special HTML characters(chr 155). Crystal was not able to correctly display the cahracters. Instead a blank space was displayed. In addition to, when the report is exported to PDF, it is displayed as boxes.
Is there a way to handle display of special HTML chars in crystal?
ThanksCrystal HTML interpreter is very limited and has been same for years, so it seems unlikley it will chnage any time soon.
As its a specific character that is failing use a replace formul to remove the long dash html and replace with a short dash html which I guess Crystal will recognise.
Replace(yourfield, 'longdashhtml', 'shortdashhtml')
Ian -
Parsing HTML characters (e.g.  )
Hi
Apologies if I'm missing something obvious, I haven't been able to find an answer searching the API or Forums...
I'm parsing HTML documents (currently as Strings) to extract certain information. Is there an easy way to replace all special HTML characters such as < etc. to a space or < respectively without having to do a string replace on every possible HTML character?
I know there's an HTML parser in swing but that seems to be geared towards creating an HTML editor.
Any help would be appreciated!There are also a number of open source or shareware programs, such as TidyHTML, that clean-up and parse existing HTML. Check out Sourceforge or www.downloads.com.
- Saish -
Sorting values by escaping the html tags
Hi Friends,
My problem is described below...
I am facing an issue where I need to sort (main title/ alternate title) by escaping the html tags.
eg 'Amex' should always be before 'Singer'
Amex in DB is like Amex.
Syngo in DB is like <i>Singer</i>
something can be --- <i>hello<i>
sql.append("SELECT DISTINCT NVL(ItemDocMeta.xMainTitle, ItemDocMeta.xAlternateTitle) AS generatedPageTitle,");
other conditions
// order by
sql.append(" ORDER BY LOWER(generatedPageTitle) ASC");
Is there any SQL function that can make it easier?
I tried using regex in the ith order by clause, but it doesnt work until i keep it in the select part. And I am unable to use regex in the select part with distinct.
ThanksFor example :
SQL> set scan off
SQL>
SQL>
SQL> with sample_data as (
2 select 'again sort a column' str from dual union all
3 select '<i>sort</i> a column' from dual union all
4 select '<i>resort<i>' from dual
5 )
6 select str
7 from sample_data
8 order by regexp_replace(
9 utl_i18n.unescape_reference(str)
10 , '</?[^>]+>'
11 )
12 ;
STR
again sort a column
<i>resort<i>
<i>sort</i> a column -
-- How can I assign an xml typed variable and take advantage of the automatic escaping of invalid characters?
-- This query escapes the character fine in MSSQLMS
SELECT * FROM (SELECT CAST(0x1B00 AS NVARCHAR(128)) AS TestCharacter) MyTable FOR XML auto
<MyTable TestCharacter="" />
-- This fails in MSSQLMS and in a similar production procedure.
DECLARE @MyXml XML
SET @MyXML = (SELECT * FROM (SELECT CAST(0x1B00 AS NVARCHAR(128)) AS TestCharacter) MyTable FOR XML auto)
Msg 9420, Level 16, State 1, Line 2
XML parsing: line 1, character 30, illegal xml character
Scott MitchellThanks for the reply. I looked at casting to varbinary but didn't want to cast the large strings that have these characters in them. Sorry for not mentioning that. My example above is simplified. The text isn't only in an attribute and can be quite large.
I want to be able to read the text by just looking at the xml.
I really would like the escaped form:
 for all the invalid characters.
Scott Mitchell -
HTML characters display incorrectly in Firefox
Special HTML characters like ∠ and ← and ∝ (etc.) do not display as they should in Firefox on my Mac.
I messed with Font Book earlier today, and though I don't think I made any fatal changes, I think that might have caused this problem (though certain symbols like ♥ had never shown up correctly).
However, all of these characters display perfectly in Safari. See:
http://www.plisher.org/safari.jpg
http://www.plisher.org/firefox.jpg
How might I fix this?Well, I just launched Firefox and opened this page in it. The angle, arrow and whatevertheotherthing is all displayed correctly, the heart however showed up in Firefox as a perpendicular line.
I'm using Firefox 2.0.0.4, with the default font set to Geneva.
Francine
Francine
Schwieder -
CF8 - XmlFormat not escaping High ASCII characters
In CF8, we have a problem where XmlFormat is not escaping
High ASCII characters. This was working just fine on our CF7
instance, but in CF8, it is not escaping all characters. I am aware
of the long-standing problem with escaping Windows-1252 characters,
but now we are experiencing an issue with basic high ASCII
characters, like chr(233) and chr(244). Is anyone else experiencing
this issue? We have not installed Update 1 to CF8 yet. I don't see
a fix for this in the release note, but any word on if this is
fixed by the updater?
Here is a test to demonstrate the issue:
<cfset myString = "The Islamic Republic of Mauritania's
(République Islamique de Mauritanie) 2007 estimated population
is 3,270,000. Cote d'Ivoire and Côte d'Ivoire">
<cfset myNewString = XmlFormat(myString)>
<cfoutput>#myNewString#</cfoutput>BKBK,
Thanks for the info. Adding the processingdirective does help
show that these characters are being escaped, however, the behavior
has changed somewhat between CF7 and CF8, as we were not using a
processingdirective in CF7, and this was working as advertised.
Where this is giving us a problem is after we create an XML
document using CFXML, (ensuring that we XmlFormat any strings), we
then validate that document against a schema, and we are all of a
sudden getting errors during validation for invalid characters
within the XML. We are using ToString() after creating the XML
document with CFXML, and our process is the same as we were using
in CF7. That is why I was curious if anyone else was having this
same issue... because something definitely changed between CF7 and
CF8 with XML processing. -
[svn] 3590: Replace invalid html characters
Revision: 3590
Author: [email protected]
Date: 2008-10-13 07:29:43 -0700 (Mon, 13 Oct 2008)
Log Message:
Replace invalid html characters
Checkin Test Passed: Yes
QA: No
Bug:
Doc: No
Modified Paths:
flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/ILayoutItem.asTry the HtmlEditFormat function built into ColdFusion.
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=functions_h-im_04.html#4 744272 -
How to escape special xml characters in ALSB
Hi
Can some one tell me how to replace special xml characters < ,> with < and >
I have xml node like below
<payload>
<RatingDetails>
<Action>Add</Action>
</payload>
Using fn-bea:serialize i got xml string as
<payload><RatingDetails><Action>Add</Action></payload>
I want output as below
<payload><RatingDetails><Action>Add</Action></payload>
Appreciate your help
Thanks in Advancewhen i use fn-bea:serialize my request xml node converted to xml string.To that string i had escaped special xml characters.
Original request:
<abc>
<a1 >123</a1>
<payload>
<d>345</d>
<e><678></e>
</payload>
</abc>
After using serialize it became as below (everything in one line)
<abc><a1>123</a1><payload><d>345</d><e><678></e></payload></abc>
then i used java callout for replacing special xml chars in payload element,
now my request is
<abc><a1>123</a1><payload><![CDATA[& lt;d& gt;345& lt;/d& gt;& lt;e& gt;& lt;678& gt;& lt;/e& gt;]]></payload></abc>
i dont want my payload data to be enclosed within CDATA but by default i am getting it when i run my xquery for generating request.
This might be because & will not get parsed in xml parser so enclosing evrything in CDATA.
Need solution to remove CDATA and send the payload data as it is.. -
Hello all,
I am creating a flex chat app. This communicates with my own
chat server.
Now I want to know what is the best way to escape characters?
I send all data in a XML document to the server, so if I type
a message: <i>test</i> the text will appear italy, as
it is not escaped.
If I use escape, it will escape to a code that the Text
control not is able to read.
I just want to know which function will replace < in
< > in > and & in &.
Thanks!I have tried esc ape and unes cape.
But these are my results:
var Str: String = '<foo>rock & roll</foo>';
Alert.show(esc ape(Str));
This will come to:
%3Cfoo%3Erock%20%26%20roll%3C/foo%3E
Thats fine for sending data, but putting it back with un esc
ape will just give me the original back (as expected).
But I want my < to be < or the equivelant ascii
code d
In PHP you use htmlentities or htmlencode, but in Flex is a
mystery.
Sorry, didn't read your post properly, I think I will have to
come up with my own replace function then :( -
Escaping carriage return characters in textarea
Hi all,
I have a HTML form containing a textarea field which users might us the carriage return.
This form is then submitted to a processing servlet which saves the data to the database.
Subsequently, I have another page which will retrieve the data using JDBC and and display these in HTML.
Here's the problem:
How do I replace the carriage return characters (seems from the database that there are 2 of them) with <br>?
I've tried using the String.replaceAll("\r\n", "<br>"), but it didn't work :-(
Thanks!Becuase you enter your patterns as expressions where some characters are used as control characters, and then have to esacpe some of the control characters in the expressions when you enter them as java strings.
So the expression is actually \r\n if you let a user enter it into a textfield, but you have to escape the \ if you write it as a String in the source code (since \ is an escape characters in strings)
/Kaj -
How to display, translate or remove html characters
Hi,
I need the ability to translate or remove the characters below to display properly in oracle apex text area. Anyone know how to do this?
Apex 4
<p>1985 World Champ. U.19 - Gold, <span style="color: rgb(255, 0, 255);"><strong>1986 World Champ. - Gold,</strong> </span>1987 Pan American Games - Gold, 1987 North American Champ. - Gold, 1987 World Cup - Gold, <span style="color: rgb(255, 0, 255);"><strong>1989 World Champ. - Gold,</strong></span> 1990 Goodwill Games - Gold, 1990 World Cup - Gold, 1991 Playa Giron - Gold, 1991 Pan American Games - Gold, <span style="color: rgb(255, 0, 255);"><strong>1991 World Champ. -
Thanks
DeanAssuming I've understood the requirement:
SQL> with t as (
2 select '<p>1985 World Champ. U.19 - Gold, <span style="color: rgb(255, 0, 255);"><strong>1986 World Champ. - Gold,</strong> <
/span>1987 Pan American Games - Gold, 1987 North American Champ. - Gold, 1987 World Cup - Gold, <span style="color: rgb(255, 0, 255)
;"><strong>1989 World Champ. - Gold,</strong></span> 1990 Goodwill Games - Gold, 1990 World Cup - Gold, 1991 Playa Giron - Gold, 199
1 Pan American Games - Gold, <span style="color: rgb(255, 0, 255);"><strong>1991 World Champ. - ' s from dual)
3 select
4 regexp_replace(s, '<[^>]*>') removed
5 , htf.escape_sc(s) escaped
6 from
7* t
SQL> /
REMOVED ESCAPED
1985 World Champ. U.19 - Gold, 1986 Worl <p>1985 World Champ. U.19 - Gold,
d Champ. - Gold, 1987 Pan American Games <span style="color: rgb(255, 0,
- Gold, 1987 North American Champ. - Go 255);"><strong>1986 World
ld, 1987 World Cup - Gold, 1989 World Ch Champ. - Gold,</strong> </span&
amp. - Gold, 1990 Goodwill Games - Gold, gt;1987 Pan American Games - Gold, 1987
1990 World Cup - Gold, 1991 Playa Giron North American Champ. - Gold, 1987 World
- Gold, 1991 Pan American Games - Gold, Cup - Gold, <span style="color:
1991 World Champ. - rgb(255, 0, 255);"><strong&g
t;1989 World Champ. - Gold,</strong&g
t;</span> 1990 Goodwill Games - Go
ld, 1990 World Cup - Gold, 1991 Playa Gi
ron - Gold, 1991 Pan American Games - Go
ld, <span style="color: rgb(255,
0, 255);"><strong>1991 Wo
rld Champ. -(Inconsistent behaviour by the Jive forum software means it isn't displaying the difference in the ESCAPED result properly...) -
Hi All,
I need to escape certain characters on our jsp pages to make them w3c compliant.
The characters I need to escape are
" to " < to < > to > & to & (but not when & is followed by # (eg &# would NOT be escaped).
EG
Raw: John & Mary are > then Sam & Helen but < George & Michelle -- 橖
Converted: John & Mary are & gt; then Sam & Helen but & lt; George & Michelle --- ;橖 I've tried to use PerlUtils but to no avail (cannot work out how to tell it not to escape the &# sequence).
Can you guys help me with to accomplish this with javas regex package (or with 1.4 String class)??
Thanks!Thanks Uncle Alice! You are the regexp king (or queen?)Of the two, "king" would be more appropriate, but I really prefer "poobah". :-)
I've been writing java apps for 5 years now and I have never touched
regex. I did do some google'ing but really couldnt find real examples
that were easy to follow.I know what you mean. This site has a pretty good tutorial, but the examples are a bit too abstract. I was hoping the Habibi book from APress would fill that void (it was originally titled Real World Regular Expressions with Java), but poor examples turned out to be the least of its problems. Your best bet is still Friedl's book -- good examples are the least of its virtues. -
String auto-converts HTML characters?
Hi all, I have an XML document that contains a field like
this:
<someHTML><b>ThisIsBolded</b></someHTML>
Now, I want to put this correctly-rendered HTML into the
htmlText portion of a Text tag. Which I try to accomplish using the
following:
var nodeHTML:String = node.someHTML.toString();
trace(nodeHTML); // Output: <b>ThisIsBolded</b>
(what!? I didn't replace anything!)
nodeHTML.replace("<","<").replace(">",">");
trace(nodeHTML); // Output: <b>ThisIsBolded</b>
(what!? replacement didn't do anything!)
myText.htmlText += nodeBody + "\n"; // Output: Plaintext
output, no bolding! But also no tags...?
Does anyone know what is going on? It seems like I can't
display HTML in the htmlText property. Any help would be
appreciated.Post Author: V361
CA Forum: General
The maximum length of a String constant, a String value held by a String variable, a String value returned by a function or a String element of a String array is 65,534 characters.
The maximum size of an array is 1000 elements.
The maximum number of arguments to a function is 1000. (This applies to functions that can have an indefinite number of arguments such as Choose).
Not sure about the HTML ?
Maybe you are looking for
-
I made a mistake and downloaded the Windows version of Elements 11.
Is is possible for someone at Adobe to switch my order so I can download a version compatible with OSX 10.6.8? I just hurried through the process too fast.
-
Downloading csv file does not ask for where to store file
Firefox is set to "Always ask me where to save files". I have a WebService from which to download a download.csv file via a POST request (must be a POST request and not a GET request due to data issues). I'm using jquery.fileDownload.js in the Websit
-
Looking for an OID string for the IE-3000 switch
I'm looking for the OID string on a IE-3000 switch to give me the results for the optical Tx and Rx power as shown in the "show interface transceiver" command (this is the output i ran directely from the IE-3000 switch, BTW):
-
Can I run Windows 7 on my imac?
Can I run Windows 7 on my Mac OSX 10.6.8w/Intel Core 2 Duo processor?
-
Help - Spry Menu Not Working Properly in Windows
http://signinterpreter.com/new/index.html It works fine on my mac in all browsers, but causes issues on IE and Chrome/IE. Any clues? Thank you!!!!