xslt + tei question

Here should go questions about transforming XML with XSLT and FOP.
saammm
Posts: 2
Joined: Mon May 01, 2017 5:40 pm

xslt + tei question

Post by saammm »

hello!

i am a student who is completely new to xml/xslt, so i believe this question has a simple answer that i'm just not seeing.

i am working on an assignment that basically requires us to develop a website prototype:
1) analyse and mark up text using tei
2) design a website to display the marked-up text
3) write xsl transformations to transform the tei into content for browser
4) design paired webpages (e.g. homepage)

i have marked up and validated my tei against a schema i've created already, but i am running into problems trying to change my content into readable material online. my hope is to write some css to attach to both the xml files and the files i will create for additional webpages (again, like a homepage or 'about' page).

i added the processing instruction <?xml-stylesheet type="text/css" href="testcss.css"?> to my xml, and it is displayed correctly in the author mode on oXygen, but none of the formatting appears in my browser. (i also added <link rel="stylesheet" type="text/css" href="testcss.css"/> to my xslt document under <title>, which is what i read was the appropriate step to take.)

i don't know how to prevent one set of instructions (xslt) from overriding the other (css), and i'm not sure if that's what is happening here... apologies as i think there is a simple thing i've just missed!

many thanks for any assistance! :)
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: xslt + tei question

Post by Radu »

Hi,
i added the processing instruction <?xml-stylesheet type="text/css" href="testcss.css"?> to my xml, and it is displayed correctly in the author mode on oXygen,
Ok, this means that the CSS matches in its selectors TEI element names and styles them in various ways.
but none of the formatting appears in my browser. (i also added <link rel="stylesheet" type="text/css" href="testcss.css"/> to my xslt document under <title>, which is what i read was the appropriate step to take.)
So your XSLT stylesheet converts the TEI to an HTML document, right? The CSS referenced by the HTML document should match in its selectors HTML elements.
So you cannot use the same CSS both to render TEI documents and HTML documents as the CSS matches specific element names.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
saammm
Posts: 2
Joined: Mon May 01, 2017 5:40 pm

Re: xslt + tei question

Post by saammm »

thank you! :) again, sorry for the basic question; i should have realised that.
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: xslt + tei question

Post by Radu »

Hi,

No problem. This confusion between using CSS to style the input XML or to style the output HTML is quite often made.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply