• Post Reply Bookmark Topic Watch Topic
  • New Topic

outputText value unexpectedly surrounded by quotes in generated HTML

 
Peter van Nes
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can somebody explain me why when i use the following outputText tag


The generated HTML is


And when i use the next outputText tag the output is enclosed in quotes



To temporarily fix something i need to generate an html tag using a param value. Here an example


Cheers,
Peter

 
Tim Holloway
Bartender
Posts: 18415
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because that's malformed XML.

Properly-formed XML would look like this:



Because when you embed HTML's 5 magic characters ( < ' " & or > ) inside of other XML, it makes for ambigous or invalid XML.

The above example wouldn't work, however, since the outputText element escapes HTML/XML by default, so the more proper way to do it would be:



The correct way to do it, however, is
 
Peter van Nes
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim,

Thanks, outputLink was what i was looking for.
Sorry for the XML screw-ups, those ended up here because i could not use the exact examples as i am using in our environment.

Cheers,
Peter
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!