Hi All,
I have a piece of HTML stored in a CDATA xml node, and would like a
way to provide the content-editor who's enters the text a friendly way
to specify a search query, something like:
<ROOT>
<bodytext><![[CDATA[this is a example of the <b>HTML</b> text.<br>
Click <searchbyname arg="john">Here</searchbyname> to
get John's search results, or click <searchbyID
arg="111">Here</searchbyID> to search by ID.
</bodytext>
</ROOT>
I figured that <searchbyname> and <searchbyID> are child elements of
<bodytext>, but I'm not sure how to do my substitutions, and then
reassemble back into a HTML string that I can output.
any ideas? or is there another way I could do this? I thought about
brute-force string.indexof() and string.replace(), but there's
probably a beter way.
Thanks
Lightman 2 2333
lightman wrote: I have a piece of HTML stored in a CDATA xml node, and would like a way to provide the content-editor who's enters the text a friendly way to specify a search query, something like:
<ROOT> <bodytext><![[CDATA[this is a example of the <b>HTML</b> text.<br> Click <searchbyname arg="john">Here</searchbyname> to get John's search results, or click <searchbyID arg="111">Here</searchbyID> to search by ID. </bodytext> </ROOT>
This is malformed XML. CDATA start tag is misspelled and end tag is
absent. Here is well-formed version:
<ROOT>
<bodytext><![CDATA[this is a example of the <b>HTML</b> text.<br>
Click <searchbyname arg="john">Here</searchbyname> to
get John's search results, or click <searchbyID
arg="111">Here</searchbyID> to search by ID.]]>
</bodytext>
</ROOT>
I figured that <searchbyname> and <searchbyID> are child elements of <bodytext>, but I'm not sure how to do my substitutions, and then reassemble back into a HTML string that I can output.
No elements in CDATA. CDATA means the content is just plain text. So to
process it use common text processing means (substring functions, regexp
etc), forget about XML facilities. Otherwise avoid CDATA.
--
Oleg Tkachenko [XML MVP] http://blog.tkachenko.com
lightman wrote: I have a piece of HTML stored in a CDATA xml node, and would like a way to provide the content-editor who's enters the text a friendly way to specify a search query, something like:
<ROOT> <bodytext><![[CDATA[this is a example of the <b>HTML</b> text.<br> Click <searchbyname arg="john">Here</searchbyname> to get John's search results, or click <searchbyID arg="111">Here</searchbyID> to search by ID. </bodytext> </ROOT>
This is malformed XML. CDATA start tag is misspelled and end tag is
absent. Here is well-formed version:
<ROOT>
<bodytext><![CDATA[this is a example of the <b>HTML</b> text.<br>
Click <searchbyname arg="john">Here</searchbyname> to
get John's search results, or click <searchbyID
arg="111">Here</searchbyID> to search by ID.]]>
</bodytext>
</ROOT>
I figured that <searchbyname> and <searchbyID> are child elements of <bodytext>, but I'm not sure how to do my substitutions, and then reassemble back into a HTML string that I can output.
No elements in CDATA. CDATA means the content is just plain text. So to
process it use common text processing means (substring functions, regexp
etc), forget about XML facilities. Otherwise avoid CDATA.
--
Oleg Tkachenko [XML MVP] http://blog.tkachenko.com This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: burn_hall |
last post by:
Hi,
I have a problem and can't figure it out and need your help, please
look at the following code and the output also a xml file snippet is
down there too.
Looking at the output I don't know why...
|
by: Alex Mizrahi |
last post by:
Hello, All!
i have 3mb long XML document with about 150000 lines (i think it has about
200000 elements there) which i want to parse to DOM to work with.
first i thought there will be no...
|
by: Yang Xiao |
last post by:
Hi all,
I'm having some problems with parsing XML with DOMParser.
What I want is to filter out particular elements in the XML, the
sample XML looks like this.
Thanks in advance.
Yang
...
|
by: Terry |
last post by:
Hi,
This is a newbie's question. I want to preload 4 images and only when
all 4 images has been loaded into browser's cache, I want to start a
slideshow() function. If images are not completed...
|
by: Hazzard |
last post by:
I am trying to create a custom section and section handler in my config
file.
The custom section should be something like;
<appSecurity>
<method name = "Protect the Ice Cream">
<allow group =...
|
by: Hazzard |
last post by:
I am trying to create a custom section and section handler in my config
file.
The custom section should be something like;
<appSecurity>
<method name = "Protect the Ice Cream">
<allow group =...
|
by: XML newbie: Urgent pls help! |
last post by:
When I try to parse: I get the following error message:
Unable to cast COM object of type
'Microsoft.SqlServer.MSXML6.DOMDocumentClass' to interface type
'MSXML2.ServerXMLHTTP40'. This operation...
|
by: XML newbie: Urgent pls help! |
last post by:
I am using Vb.net. I am new to XML.I appreciate your help in advance. Please
reply soon.
When I try to parse: I get the following error message:
Unable to cast COM object of type...
|
by: WTH |
last post by:
In C++ I had, long ago, written my own XML parsing class as I never found
even a half decent node based hierarchical solution that was simple, now
that I'm starting to develop tools in C# (as a...
|
by: nicky123 |
last post by:
Hi everyone,
This is a brief description that I have provided for parsing & displaying an XML document using DOM API. Please feel free to post your own comments & views regarding...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |