Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: XML, XSD, CSS and XSLT  (Read 3492 times)

0 Members and 1 Guest are viewing this topic.

r0543

  • Guest
XML, XSD, CSS and XSLT
« on: January 11, 2009, 04:23:16 PM »
I have a well-defined XML schema and presently use a CSS to render XML files conforming to it on screen in a slightly more user-friendly fashion. However, CSS is not able to support varied formatting within generated elements. I understand that XSLT and FO are able to do this. I therefore want to write an XSLT file that does the equivalent of my present CSS, that I can then adapt to add more complex conditional formatting.

Is there an easy or programmed solution to translating a fairly complex CSS into the XSLT equivalents (http://www.re.be/css2xslfo/ doesn't work)? What structures and forms in XSLT are the exact equivalent of what in CSS?

For instance - here is an extract from the CSS:

Quote
doc {font-family:'times new roman', times, serif;
font-size:13pt;
font-weight:normal;
font-style:normal;
font-variant:normal;
display:inline;
margin-left:2cm;
margin-right:2cm;
line-height:150%}

entry+entry:before {content:"\a\a"}
entry[xref=yes]+entry:before {content:"\a\a"}
entry[xref=yes]+entry[xref=yes]:before {content:"   "}
entry[xref=yes] {font-size:80%}

lm+lm:before {content:", ";font-weight:bold}

hom {font-weight:bold}
hom:after {content:" ";font-weight:bold}
fl:before {content:"\2020";font-weight:bold}
l {font-weight:bold}
l+et:before {content:" ["}
et:after {content:"]"}

e:before {content:attr(lang)" ";font-style:normal}
e+e:before {content:" "}
rel+e:before {content:" "}
e[lang="O"],e[lang="S"],e[lang="E"],e[lang="N"],e[lang="I"] {font-style:italic}
e[lang="C"],e[lang="L"],e[lang="M"] {font-style:normal}

rel {font-style:normal}
e+rel:before {content:" "}

note {font-style:italic}
note[br="rd"]:before {content:"(";font-style:normal}
note[br="rd"]:after {content:")";font-style:normal}
note[br="sq"]:before {content:"[";font-style:normal}
note[br="sq"]:after {content:"]";font-style:normal}

What would the XSLT equivalent for this be?