Advertisements

I had avoided XSLT because that was just something else to learn and
would delay me and I assumed since the code I was using was from
W3schools that it should be compatible across the board but I guess
not and I'll have to do it the proper way.

Frank Stallone wrote:
> I'm working on a basic css/html/xml template for my websites. I have
> as much design stuff as I can put into the CSS file.

OK so far.
> I want all my data in the xml file so my html file is, for the most
> part, pulling the data from the CSS and XML file to create a page.

This is where it starts to fall apart. "Pulling" XML data from within
an HTML file is a non-standard bodge.
> I'm very new to XML and google hasn't really turned up anything
> useful.

Not surprising, I'm afraid. Did you manage to find the FAQ athttp://www.ucc.ie/xml ?
> Ideally what I want to do is have the code in the html to link a
> datafield in the xml file - like this
>
> <span datasrc="#xmltext" datafld="article"></span>

The number of browsers that this works in is probably rather limiting.
> Then in my xml file I would want something like
>
> <file>
> <article>
> blajhfierewr e9rue 9fjfidsfjdsifs <a
> href="http://www.fake.com">fake</a> blah blah blah <img
> src="http://www.picture.com/wang.jpg" /> blkjfriue-r blah blah, etc,
> etc
> </article>
>
> Is this even possible? If a use for XML is to keep data seperate from
> the html then surely there has to be a way to include links to sites
> and images as most written articles have them.

Absolutely.

As David suggested, so it on the server with Cocoon or AxKit, or even
statically with Saxon or similar. An XSLT stylesheet will easily transform
your XML to HTML, eg if your XML file says:

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!