[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.as

Try the HtmlEditFormat function built into ColdFusion.
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=functions_h-im_04.html#4 744272

Similar Messages

  • Replace invalid XML characters using SQL query

    Hi,
       I am populating a dataset in .net with output from sql 2005 database. One of the columns in the table is a 'varchar(max)' type. This dataset is then converted to XML using WriteXml and written to a .xml document. But due to the presence of invalid characters, this process errors out.
    Is there any way using which these invalid characters can be replaced at the database level itself when querying on the table?
    The error that is produced is as follows:
    '', hexadecimal value 0x1C, is an invalid character. Line 32201, position 924. 
    Thanks,
    Nisha

    I see,
    So we have a certain character that the XML processor does not like. What do you want to do with this character? Even if you manage to make an XML file wth this some how, you will get the same problem when another application tries to read it.
    Probably you should replace those characters before converting the values to XML.
    Another option is to put the values to the CDATA. This will be tough because the query might be little tricky. Here is an example that might help you.
    Code Snippet
    CREATE TABLE CDataTest (SomeValue NVARCHAR(50))
    INSERT INTO CDataTest (SomeValue) SELECT 'Some Value ' + CHAR(25) + 'Some OtherValue'
    SELECT * FROM CDataTest FOR XML AUTO, TYPE
    error!!!
    FOR XML could not serialize the data for node 'SomeValue' because it contains
    a character (0x0019) which is not allowed in XML. To retrieve this data using
    FOR XML, convert it to binary, varbinary or image data type and use the
    BINARY BASE64 directive.
    -- option using CDATA
    SELECT
    1
    AS Tag,
    NULL AS Parent,
    (SELECT
    SomeValue AS 'data()'
    FROM CDataTest
    FOR XML PATH('')) AS 'SomeValue!1!SomeValue!cdata'
    FROM CDataTest
    FOR XML EXPLICIT, TYPE
    <SomeValue>
    <SomeValue><![CDATA[Some Value &#x19;Some OtherValue]]></SomeValue>
    </SomeValue>

  • Convert invalid xml characters to HTML-Entity

    Hi,
    How can i convert invalid XML characters like �,�,�, . . . to the HTML- Entity &auml &uuml &ouml ?
    Is there any Method or class who can handle an input string and transform the invalid characters?
    Or is there another way to mask this characters so that an XML parser do not throw an error when parsing the document.
    Best regards,
    Michael

    Ok sorry, I'll give you more details what i want to do and where i have the problems.
    I have the following xml string:
    <font family="Times New Roman" size="14" color="#333333">This is a sample Text</font>
    The xml-string can contain any characters because the content is from a text pane where the user can type in any characters.
    I use the DOM parser to parse this input string to get the attributes and the text content.
    And thats my problem, how can i make sure that this string wont throw any exceptions when i parse it with DOM?
    Parsing the string with the follwing code:
    public XMLElement parse(String sourceString)
            //create a new xml element
            XMLElement xmlElement = new XMLElement();
            //create a new document
            DocumentBuilder builder = build();
            //now parse the string into the document
            InputStream is = new ByteArrayInputStream(sourceString.getBytes());
            Document document = null;
            try
                document = builder.parse(is);
            catch (SAXException e)
                System.out.println("SAXError while parsing the document");
                e.getMessage();
                //no valid document
                return null;
            catch (IOException e)
                System.out.println("IO Error while parsing the document");
                e.getMessage();
                //no valid document
                return null;
            //get the element
            org.w3c.dom.Element element = document.getDocumentElement();
            if (element != null)
                xmlElement.setNodeName(element.getNodeName());
                xmlElement.setNodeValue(element.getTextContent());
                //attributes defined?
                int length = element.getAttributes().getLength();
                //get the attributes, if defined
                for (int i = 0; i < length; i++)
                    xmlElement.addAttribute(
                            element.getAttributes().item(i).getNodeName(),
                            element.getAttributes().item(i).getTextContent());
            return xmlElement;
        } XMLElement is my own class.
    The builder:
    private DocumentBuilder build()
            DocumentBuilder docBuilder = null;
            try
                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                docBuilder = factory.newDocumentBuilder();
            catch(ParserConfigurationException pce)
                System.out.println("Error while creating an DocumentBuilder");
                pce.getMessage();
            //return the document builder
            return docBuilder;
        }Message was edited by:
    heissm - spelling mistakes :(

  • Special HTML Characters

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

    Crystal 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. &nbsp)

    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

  • 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

  • Invalid HTML tag - Is this true? Child .chm files cannot have underscores in name?

    I’ve been having the following problem:
    file mk:@MSITStore:  … xxx.chm::/xxx.hhc contains an invalid HTML tag
    In more detail what happens:
    You click on the .chm file to open it and you get a dialog with an error message:
    The file mk:@MSITStore:E:\p4_work\1663\isentris\isentris\end-user\trunk\src\Symyx_Isentris\!SSL!\M icrosoft_HTML_Help\Symyx_Isentris.chm::/Symyx_Isentris.hhc contains an invalid HTML tag
    There is an OK button and when you click that, then the .chm file opens just fine.
    All child .chms open fine when I click on them.
    This merged help project worked fine until I upgraded from RH X5 to RH7. I hadn’t changed anything. Then I started reading the forum (RoboHelp HTML Help).
    What I’ve done so far:·         Upgraded all help projects from RH X5 to HR7.
    ·         Regenerated all .chm files, added them again to parent help project’s TOC.  Child .chm files open fine.
    ·         Regenerated a new parent .chm.
    So, I see that one of Colum's answers in another thread was to make sure that none of the child .chms had underscores in the title.
    >>>>>>>>>> !!!!!!!!   you mean that RoboHelp now does not accept underscores in .chm titles? Please don’t let it be so.
    Also, several people said that they solved the problem like this:
    ·         “You will get this message if your merged CHMs are not in a book in your merged TOC. Check that. “  You mean I have to associate a book icon with each child .chm in the parent’s TOC?
    ·         My guess is that the merged project should be placed inside a book in the main project's TOC. You'll just have to rearrange the subprojects TOCs so you don't have books inside books.
    What does “in a book” mean? See my attached jpegs. The child project’s TOC is in book form  … within the child project. However, in the parent project’s TOC, the child projects are shown with that merged symbol … kinda looks like a very angular G. Should I create books that link to destinations? Is that what I should do in the parent project’s TOC? Somehow that doesn’t look like it’s going to work – I looked at both dialogs – link and no link – neither one looked like it would work.
    Thanks so much for your help!!

    When you have a directory path in the TOC, that means that the directory structure should match. So for example:
    TOC (in parent.chm)
      !SSL!\Microsoft_HTML_Help\symyx_client.chm
      symyx_for_excel.chm
    End folder structure: (+ for folder, - for file)
    + Help
       - parent.chm
       - symyx_for_excel.chm
         + !SSL!
            + Microsoft_HTML_Help
               - symyx_client.chm
    Now if the symyx_client file shows up okay after the error message, possibly the parent chm file is smart enough to correct for the directory structure not being there, but a file with the correct name existing in the same directory as the parent.
    We've always tried to ensure out merge references don't have a path - RH has the annoying habit of requiring the chm file to be copied into the root, but we just delete it after the first build, as it shouldn't need to be there for the actual compile process. In fact, we've had problems with the chm being physically built into our parent chm, drastically increasing the file size and resulting in duplicate and outdated topics in search. We leave the file there for the first build as sometimes the merge doesn't work first go without it; I think it has to do with how it gets added to the hhp file.
    To test that our merge works, we just copy a couple of the files into the same folder  (e.g. c:\temp\test) to double-check. We need this process as our clients get different combinations of the total chm files built into our parent.
    Something else I've just thought of is maybe there is something strange happening in the actual hhc file. Do you have any topics in that TOC with characters other than a-z, 0-9 and underscore in the filename (in the topic title should be okay, but maybe some particularly odd ones might cause an issue)?
    Amber

  • This board and "Your post has been changed because invalid HTML.."

    I have got warning messages when previewing and posting of...
    "Your post has been changed because invalid HTML was found in the message body. The invalid HTML has been removed. Please review the message and submit the message when you are satisfied."
    Why can't you just allow users to post "code" samples.
    Here are examples on posting code on another site with forums..
    http://www.dslreports.com/faq/1037
    http://www.dslreports.com/forum/remark,8477196
    Quick two quote(s) from that last URL
    #1 A code block is very useful when you do not wish anything you type to be interpreted (or misinterpreted) within the code block itself. The format of the text is also exactly preserved, all spaces, and everything.
    #2 Within a code block, special characters, > ' &
    and so on, can be used without any interpretation
    being done on them by the forum software or by the
    viewers browser.
    If it is possible to do that here, how does one do that?
    Please and thank you.
    If you are the original poster (OP) and your issue is solved, please remember to click the "Solution?" button so that others can more easily find it. If anyone has been helpful to you, please show your appreciation by clicking the "Kudos" button.
    Solved!
    Go to Solution.

    Hi dslr595148,
    That is certainly possible and has been implemented. When you are in the editor writing a post look above the window for this symbol. 
    Thanks for the suggestion!

  • Replace multiple space characters with a single space

    Hi,
    Oracle 11g R2.
    Looking for a way to replace multiple space characters in a row with a single space. For example, the text "abc abc" should look like "abc abc". I tried toying with replace, but it only works for the case of 2 spaces. Need a solution for the cases where there could be 2 or more spaces.
    select replace(column1, chr(32)||chr(32), chr(32)) from tablea

    Hi,
    If you had to do this without regular expressions, you could use:
    SELECT  REPLACE ( REPLACE ( REPLACE (str, ' ', '~ ')
                     , ' ~'
              , '~ '
              )     AS new_str
    FROM    table_x;assuming there is some sub-string (I used '~' above) that never occurs right next to a space.
    However, unless you're uisng Oracle 9 (or earlier, which you're not doing) you don't have to do this without regular expressions. As you can see, the way Solomon showed is much simpler.

  • RH 7 generating invalid html files

    First I should say that this is a foreign language project.
    The default language has been changed accordingly.
    When I generate WebHelp, from Single Source Layout, the
    output view shows that about 10% of my topics are duplicated as
    invalid html files. For example, I have a topic called
    "Navigation." RH updates/generates that topic properly
    (navigation.htm) but also generates an invalid topic along with it
    (navigation_text0.htm).
    The output view flags these invalid topics with warnings, and
    links to the corresponding
    valid topics do not work. In fact, several links within the
    project return a "IE cannot display the page" error, even though
    the links are definitely set up properly. If I close the project,
    or regenerate, some of those links will then work, though I have
    made no changes. So, it's arbitrary.
    What is wrong?

    Hi there
    Assuming you used defaults, look at your !SSL!\WebHelp folder. You upload all files and folders inside this folder.
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7 or 8 within the day - $24.95!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • Replace function - special characters

    Hi All,
           If my column is encountering special characters I would like to replace with blank. Special characters may vary from record to record. Sometimes it is @ sometimes $,!,,$,^,<,&,<,>,?,",{,},+,_,),(.
    Do we have any function same like replace that can replace all special characters, whatever it encounters with required value?
    - please mark correct answers

    Take a look at this article
    T-SQL:
    How to Find Rows with Bad Characters
    and check See Also section in that article for more articles on that topic.
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles
    Thanks Naomi
    - please mark correct answers

  • Found invalid html file ??

    For WebHelp text popup boxes, early versions of RH stored the
    text in the topic.
    Since RH5X, maybe earlier, RH generates small html files with
    file names like this:
    Topicfilename_text0.htm
    Topicfilename_text1.htm
    Topicfilename_text2.htm
    Secondtopicfilename_text0.htm
    Secondtopicfilename_text1.htm
    Secondtopicfilename_text2.htm
    The popup JavaScript in the topic refers to the appropriate
    text file.
    That works fine.
    When generating WebHelp, RH6 logs a warning line:
    Warning: found invalid html file Topicfilename_text0.htm for
    webhelp.
    Warning: found invalid html file Topicfilename_text1.htm for
    webhelp.
    and so on. I thought perhaps I had inadvertently imported
    some of these output files into the project, or mistakenly put them
    into the project source folder. But I didn't find them there, only
    in the output.
    So it appears that RH is generating valid output files,
    putting these "invalid" files in the output folder, and warning
    about them in the Output pane.
    No harm done here, of course. But I hadn't noticed this
    before now.
    Harvey

    Heya hughbetcha
    Let's say you have a topic named Candles.htm. If you insert a
    text-only popup into this topic and generate WebHelp, an additional
    HTM topic page is created for each text-only popup you have. The
    name is a variant of your main topic name.
    Not sure why you are seeing a warning message though.
    Cheers... Rick

  • Invalid XML characters

    When parsing String to XML, I get org.xml.sax.SAXParseException, with the message: An invalid XML character (Unicode: 0xb) was found in the element content of the document.
    What are invalid XML characters? How do I avoid this Exception?
    Thanks.

    Here is what the XML Recommendation says are valid characters for XML:Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]Invalid characters are anything else. And it should be obvious that to avoid that exception you should not attempt to parse files that contain any invalid characters.

  • JSF renders invalid HTML code?

    Hi
    I'm new to JSF, but I know JSTL well. I'm trying to modify an existing JSF application, but there's one thing I don't understand: Since there can only be one <f:view> in the page, it must contain both the HTML <head> and <body>.
    Now, when I look at the rendered HTML code, I see something like this:
        </body>
      <form id="linkDummyForm" name="linkDummyForm" style="display:inline" method="post" action="/srclient/faces/jsp/start.jsp"><input type="hidden" name="jsf_tree_64" id="jsf_tree_64" value="H4sIAAAAAAAAA  (etc. etc.)
    </form>
    </html>This is clearly invalid HTML code. Is there a way to change the way that f:view is rendered?
    Btw, I'm using MyFaces.
    Thanks for any help!

    Any update on above issue, its urgent.

  • 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

Maybe you are looking for