Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to make XML tag hyperlink using external CSS file

Status
Not open for further replies.

vijjay

Programmer
Feb 19, 2003
15
CA
I am trying to render / display a XML document (it contains data) into web browser (this whole thing is using DTD, XML, CSS, XHTML) and I am using external CSS file for formatting; I have a problems and I need help, if someone can figure out how:

How to make XML tag / text Hyperlink using external CSS file and my XML tags names are: <email href=….>, <picture href=….>, <otherlinks> NOT like <a>
Any idea how to make XML tags a hyperlink using external CSS file

Thanks all whoever will read and response with any solution.

Vijjay

 
What mechanism are you using to transform your document to XHTML? If you are using XSLT, you can just use that to create your hyperlinks.
 
I know how to use XSL to make hyperlink but if use CSS then do not know how to make hyperlink. I also tried to change my XML tags to <a.....><img....> when formating with CSS and display in browser it shown simple text not hyperlink.

Here is what I am trying to do:
1) I have XML file which has tags with data like:
<a href=&quot;myemail@hotmail.com&quot;>
<img src=&quot;mypic.gif&quot;>
<email href=&quot;myemail@hotmail.com&quot;>
2) formatting of XML file is done in external CSS file like: format.css

3) then in XML file, begining of document, I added these 3 lines of code:

<?xml version=&quot;1.0&quot;?>
<!DOCTYPE my-resume SYSTEM &quot;resume.dtd&quot;>
<?xml-stylesheet href=&quot;rich.css&quot; type=&quot;text/css&quot;?>
then rest of xml documen
4) I drop this XML file into browser, it display all xml data in proper format as described in CSS file but:
a) does not display picture
b) does not show hyperlinks and shows as simple text.

Any idea, what I am doing wrong in CSS or something else.

Thanks,
Vijjay
 
XML is just a markup language. The tags themselves don't have any specific meaning to a browser. In HTML, the browser knows what <img> means, but in XML, it doesn't mean anything to the browser.

In my opinion, CSS is not powerful enough to transform XML documents. You can do simple text formatting, and even use pseudo classes and DHTML, but I don't think it's the best choice.
 
mulligh is right, you cannot use CSS to effect your XML file. You must first convert it using XSL. You can add information about your CSS classes to either the XML file or the XSL filein order for them to be present in your final HTML file.

Good Luck
 
Thanks all responding my problem, I think you guys are right.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top