This week's book giveaway is in the Agile forum.
We're giving away four copies of Head First Agile and have Andrew Stellman & Jennifer Greene on-line!
See this thread for details.
Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Escape characters of primefaces editor to do a query on sparql  RSS feed

 
Dave Alexander
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there, How do I escape the characteres of a primefaces editor?
I have this in form in a xhtml page

<p:editor value="#{managebeanX.valor}" />

but when I try to save this value through a sparql query it says:
virtuoso.jdbc4.VirtuosoException: SQ074: Line 2: SP030: SPARQL compiler, line 2: syntax error at 'Apple' before '-'

Here is the sparql query
INSERT INTO GRAPH <http://localhost:8890/Asst> {

<http://www.dominio.edu#Q1> rdf:type asst:Question; asst:prompt "adada <span class="Apple-tab-span" style="white-space:pre"> </span>"^^xsd:string. }

The Blue text is the value of the p:editor. It' has html characters... So I think I need to scape those characters... but how?

Thanks in advance!
 
K. Tsang
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try adding escape="false" to p:editor. FYI this escape flag is true by default.
 
Dave Alexander
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
p:editor doesn't have the escape attribute, just <h:outputText escape="false" > does..
 
K. Tsang
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If primefaces can't escape it for you then you may need to do it before display it.

Is it possible to make such tags surround by <![CDATA[....]]>

Is there a program that parse/dissect the xml file into the schema/DTD elements?
 
Dave Alexander
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know.. but I escape that string with a java function replaceAll()... it works..
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!