Link to home
Start Free TrialLog in
Avatar of pelnisgproup
pelnisgproup

asked on

load specific content xml(xsl) into html

<body>

 <div id="nav">
   <ul>
      <li id="9ebae5de1075efb4699abaaf106acf57">get content</li>
   </ul>
 </div>

 <div id="data">
    <-- load content xml here and style with xsl-->
 </div>

Open in new window


 ?xml version="1.0" ?> 
<document>
	<section id="6935f04648c3c3b47542a63ca4609cc7">
		<data>Start cover</data>
	</section>
	<section id="9f0c662896f9d254c1c265bc1b7af92d">
		<data>TOC</data>
	</section>
	<section id="f824d88cb5b7cef4cd861b2be72e04bb">
		<data>Argumentary</data>
		<chapter id="ebdddb985a739f84b58fcca1fb2ca378">
			<data>Chapter 1</data>
			<subchapter id="be91fade2e1cf544f93919b17d300e10">
				<data>Subchapter 1.1</data>
				<topic id="3b942fae1596a5e4a94c073ea040781e">
					<data>Topic A</data>
					<paragraph id="9ebae5de1075efb4699abaaf106acf57" level="1">Welldone</paragraph>
					<paragraph id="30ddac0f0c0de76479e64d16ed645873" level="2">not so good</paragraph>
					<paragraph id="1a53acd31aaa89d40172923ff2b20cb2" level="3">That look good.</paragraph>
					<paragraph id="a389dad1a9ddf9c4190cf6e2caf5bc25" level="1">yes it it.</paragraph>
				</topic>
				<topic id="9bafd300ad209e9489a4dd7acf0a6e06">
					<data>Topic B</data>
					<paragraph id="f65352c0e8ce90e4b990c3a0a8087968" level="1">Some text hello </paragraph>
					<paragraph id="e985b199564be424f52cf9d190bc42f2" level="1">some text.</paragraph>
				</topic>
			</subchapter>
</chapter>
</section>

Open in new window


I want when user cick on li that has id= 9ebae5de1075efb4699abaaf106acf57 then load content from xml put back ( fomart with xsl to <div id="data">)

Anyone could give me some code that I achieved this?
Avatar of Rob
Rob
Flag of Australia image

How are you loading the xml? Ajax?
What is the server environment? Ie php, .net
I would suggest loading the xml into JavaScript when the page loads, parsing into an object/array, indexed by your UIDs.
I'll post some code showing you what I mean when I get back to my computer
This was an example of leading and parsing xml that I did the other day http://jsbin.com/UkufIGi/2/edit
ASKER CERTIFIED SOLUTION
Avatar of Rob
Rob
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial