• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

xsl tag problem?

 
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am wondering why I get errors if I put a html break
tag in my xsl file

here is the xsl file


Works fine when I put starting and closing br tags but gives me an error if I just use

tags ,...etc with no closing tag.
My question is if I am going to embed html,xhtml ...etc in my xsl file must I always close the tags even if in valid html it isn't really required a

to break to the next line just


Also I am wondering why the attributes that do my styleing are not displaying at all just the standard texted???

Thanks

 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your XSL file has got to be valid XML. That means either closing tags or proper empty tags - e.g. <br/>. (Which you have to do anyway if you want it to be valid XHTML).

If you've got the output method set correctly (using <xsl:output>) it will sort out the output for you. E.g. using <xsl:output="html" /> will make sure <br/> tags in the document are output as <br>.
 
Sam Doder
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok , got you so you must either use xhtml or close every start tag with an end tag.

But do you mean you can use just the regular old html br syntax if you do
<xsl:output="html" method="html" encoding="UTF-8" />

because I tried that and it still gave me errors also the style of the font,...etc attribute are not working ???

Here is my xml file if you have a chance and could explain why the style attributes aren't working as well that would be great.



my xsl is named t2.xsl change according to your xsl file name...etc
 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sam Doder wrote:But do you mean you can use just the regular old html br syntax if you do
<xsl:output="html" method="html" encoding="UTF-8" />


No. Your XSL is still an XML document, so it has to be valid XML - you've got to use <br/>. But you can have <br> in the output if you want, by setting the output method.

Sorry, I haven't used XSL-FO, so I don't know what the problem with the styling is. What's the exact output that's being produced? That might help.
 
Sam Doder
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I thought xsl was not xml it is an extension of css to take an xml and display it in a human readable format like xhtml in a web browser... etc

Sorry, I haven't used XSL-FO, so I don't know what the problem with the styling is. What's the exact output that's being produced? That might help.




if you test out it on your computer you should see a plane format ....

Curious does anybody know if you can use external xsl files instead of external css files in an xhtml or html file?
Or is xsl only used for xml based files and transforming xml files..etc?
 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sam Doder wrote:
I thought xsl was not xml it is an extension of css to take an xml and display it in a human readable format like xhtml in a web browser... etc


It's a language for transforming and formatting XML, but it's also an XML format in its own right. Check out the first line of your stylesheet.
 
Sam Doder
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
O, never looked at it like that....

So in theory you could use an xsl file to display an xsl file provided you rename the .xsl file that you included the other xsl file as a .xml....

duno why you would ever do such a thing but it should be possible.

Both are xml based files but usually 99% of the time xsl is only for displaying an xml page and really isn't considered an xml data storage file.

 
Space pants. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic