xbl1 Posted October 7, 2007 Report Share Posted October 7, 2007 Hi;Hi;I am trying to use the css to display xml file, i works in my harddrive, but it does not work when i upload to my hosting, and put them into public_html folder. Could you tell me why? please.My code as following:index.xml <?xml version="1.0" encoding="ISO-8859-1"?><!-- Edited with XML Spy v2007 (http://www.altova.com) --><?xml-stylesheet type="text/css" href="/cd_catalog.css"?><CATALOG> <CD> <TITLE>Empire Burlesque</TITLE> <ARTIST>Bob Dylan</ARTIST> <COUNTRY>USA</COUNTRY> <COMPANY>Columbia</COMPANY> <PRICE>10.90</PRICE> <YEAR>1985</YEAR> </CD> <CD> <TITLE>Hide your heart</TITLE> <ARTIST>Bonnie Tyler</ARTIST> <COUNTRY>UK</COUNTRY> <COMPANY>CBS Records</COMPANY> <PRICE>9.90</PRICE> <YEAR>1988</YEAR> </CD> <CD> <TITLE>Greatest Hits</TITLE> <ARTIST>Dolly Parton</ARTIST> <COUNTRY>USA</COUNTRY> <COMPANY>RCA</COMPANY> <PRICE>9.90</PRICE> <YEAR>1982</YEAR> </CD> <CD> <TITLE>Unchain my heart</TITLE> <ARTIST>Joe Cocker</ARTIST> <COUNTRY>USA</COUNTRY> <COMPANY>EMI</COMPANY> <PRICE>8.20</PRICE> <YEAR>1987</YEAR> </CD></CATALOG> cd_catalog.css CATALOG{background-color: #ffffff;width: 100%;}CD{display: block;margin-bottom: 30pt;margin-left: 0;}TITLE{color: #FF0000;font-size: 20pt;}ARTIST{color: #0000FF;font-size: 20pt;}COUNTRY,PRICE,YEAR,COMPANY{display: block;color: #000000;margin-left: 20pt;} Link to comment Share on other sites More sharing options...
boen_robot Posted October 7, 2007 Report Share Posted October 7, 2007 Are you sure the location to the CSS file is correct? The path /cd_catalog.css Selects the file from the document root, as seen by the browser. So if your host is OK, and you get your own domain, say "example.com", then the CSS will be fetched from example.com/cd_catalog.css regardless of the actual location of the XML file.If the files are both located in a subdirectory, for example example.com/~usr/ Then the path must be cd_catalog.css (without the leading slash)If you could provide a link to the XML file as presented on your host, then I'll be able to say for sure. Link to comment Share on other sites More sharing options...
xbl1 Posted October 8, 2007 Author Report Share Posted October 8, 2007 Are you sure the location to the CSS file is correct? The path/cd_catalog.css Selects the file from the document root, as seen by the browser. So if your host is OK, and you get your own domain, say "example.com", then the CSS will be fetched from example.com/cd_catalog.css regardless of the actual location of the XML file.If the files are both located in a subdirectory, for example example.com/~usr/ Then the path must be cd_catalog.css (without the leading slash)If you could provide a link to the XML file as presented on your host, then I'll be able to say for sure. http://businessfind101.com/ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now