473,397 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

XSLT related exception

Hi friends,
This is a sincere request to all of you guys..I need help
First time When I login into a page,it is succeded, after that i changed the url to the previous one and try to login once again , but this time i am geting exception like
-------
Exception: in FillFormService.getHTML(), msg: TransformerConfigurationException: ParseXMLwithStylesheet.run(), msg: javax.xml.transform.TransformerConfigurationExcept ion: javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: Expected ], but found: Assistans
------------
Can anyone please help me out from this problem?
thnx..
May 3 '07 #1
7 1576
dorinbogdan
839 Expert 512MB
Welcome to TheScripts TSDN....


Please post your XML and XSL code.
It sounds like a syntax error in XSL.
May 3 '07 #2
I m not able to put XSL here..
May 7 '07 #3
Welcome to TheScripts TSDN....


Please post your XML and XSL code.
It sounds like a syntax error in XSL.
Hi,
can you pls check if anything is wrong in my XSLT..there are two XSLTs..pls check it and let me know thnx ..

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8" ?> 
  2. - <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xalan="http://xml.apache.org/xslt">
  3.   <xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="yes" indent="yes" cdata-section-elements="description" /> 
  4. - <!-- 
  5.         This stylesheet generates xml of the form:
  6.         <FIELDS>
  7.             <FIELD pushmail="0" type="13" description="News" publicField="0">
  8.                 <FIELDALIAS>TESTTESTTEST</FIELDALIAS> 
  9.                 <VALUES>
  10.                     <VALUE category="News">Finance</VALUE> 
  11.                     <VALUE category="News">News</VALUE> 
  12.                     <VALUE category="Dette er en test">TESTTEST1</VALUE> 
  13.                     <VALUE category="Dette er en test">test2</VALUE> 
  14.                     <VALUE category="Dette er en test">TESTTEST3</VALUE> 
  15.                     <VALUE category="Dette er en test">test4</VALUE> 
  16.                 </VALUES>
  17.             </FIELD>
  18.         </FIELDS>
  19.  
  20.  
  21.   --> 
  22. - <xsl:template match="/">
  23. - <submission>
  24. - <FIELDS>
  25. - <xsl:for-each select="//field[.//input[@type='radio' or @type='checkbox']]">
  26. - <FIELD>
  27. - <FIELDALIAS>
  28.   <xsl:value-of select="@alias" /> 
  29.   </FIELDALIAS>
  30. - <description>
  31.   <xsl:value-of select="./description" /> 
  32.   </description>
  33. - <VALUES>
  34. - <xsl:for-each select=".//input">
  35. - <xsl:if test="@value[.!='']">
  36. - <VALUE>
  37.   <xsl:value-of select="@value" /> 
  38.   </VALUE>
  39.   </xsl:if>
  40.   </xsl:for-each>
  41.   </VALUES>
  42.   </FIELD>
  43.   </xsl:for-each>
  44.   </FIELDS>
  45.   </submission>
  46.   </xsl:template>
  47.   </xsl:stylesheet>
2..
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8" ?> 
  2. - <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xalan="http://xml.apache.org/xslt">
  3.   <xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="no" indent="yes" cdata-section-elements="description" /> 
  4. - <xsl:template match="/">
  5. - <fields>
  6. - <xsl:for-each select="//submission[1]/FIELDS">
  7. - <xsl:for-each select=".//FIELD">
  8. - <field>
  9. - <xsl:attribute name="alias">
  10.   <xsl:value-of select=".//FIELDALIAS" /> 
  11.   </xsl:attribute>
  12. - <xsl:for-each select=".//VALUE">
  13. - <xsl:call-template name="count">
  14.   <xsl:with-param name="value" select="." /> 
  15.   <xsl:with-param name="alias" select="ancestor::FIELD/FIELDALIAS" /> 
  16.   </xsl:call-template>
  17.   </xsl:for-each>
  18. - <description>
  19.   <xsl:value-of select="./description" /> 
  20.   </description>
  21.   </field>
  22.   </xsl:for-each>
  23.   </xsl:for-each>
  24.   </fields>
  25.   </xsl:template>
  26. - <xsl:template name="count">
  27.   <xsl:param name="value" /> 
  28.   <xsl:param name="alias" /> 
  29. - <value>
  30. - <xsl:attribute name="name">
  31.   <xsl:value-of select="." /> 
  32.   </xsl:attribute>
  33. - <!--  
  34.                 The -1 at the end compensates for the extra field inserted so it is possible to see values and
  35.                 or fields that has not been submitted
  36.  
  37.   --> 
  38. - <xsl:attribute name="count">
  39.   <xsl:value-of select="count(//FIELDS[FIELD[FIELDALIAS[.=$alias]]//VALUE[.=$value]])-1" /> 
  40.   </xsl:attribute>
  41.   </value>
  42.   </xsl:template>
  43.   </xsl:stylesheet>
May 14 '07 #4
Welcome to TheScripts TSDN....


Please post your XML and XSL code.
It sounds like a syntax error in XSL.
Hi,
can you pls check if anything is wrong in my XSLT..there are two XSLTs..pls check it and let me know.. thnx ..here is my code that generates that specified exception...

Expand|Select|Wrap|Line Numbers
  1.  
  2. try{
  3.  
  4.     DAODomino dao = null;
  5.     DominoAccessVO domAccessVO = null;
  6.  
  7.     dao = new DAODomino();
  8.     domAccessVO = new DominoAccessVO();
  9.     domAccessVO.setCookie(cookies);
  10.     domAccessVO.setDominoURL( server+"/"+ffDbPath+"/formResultsXML?ReadForm&RestrictToCategory="+(String)collFillFormURL.get(0)+"&count=-1" );
  11.     String strResults =dao.getData(domAccessVO, requestSetting.getWebSphereSetting()).getDominoTxt();
  12.  
  13.     dao = new DAODomino();
  14.     domAccessVO = new DominoAccessVO();
  15.     domAccessVO.setCookie(cookies);
  16.     domAccessVO.setDominoURL( server+"/"+ffDbPath+"/viewDefinitionForms/"+(String)collFillFormURL.get(0)+"/$File/FormDef.xml" );
  17.     byte[] byteArrFormDef = dao.getData(domAccessVO,requestSetting.getWebSphereSetting()).getDominoTxt().getBytes();
  18.  
  19.  
  20.     String strFormDefValues = new ParseXMLwithStylesheet().getResult(
  21.     new ByteArrayInputStream(byteArrFormDef),
  22.     new ByteArrayInputStream(
  23.     ResourceLoader.getResource(
  24.     "ParseFormDefResults.xsl",
  25.     requestSetting.getSiteSetting().getEncoding()
  26.     ).getBytes()
  27.     )
  28.     );
  29.  
  30.     int index = strResults.indexOf("<submission>");
  31.     strResults = strResults.substring(0,index) + strFormDefValues + strResults.substring(index);
  32.  
  33.     /*
  34.      * Generate XSL for profile replace.
  35.      */
  36.     msg = new ParseXMLwithStylesheet().getResult(
  37.     new ByteArrayInputStream(strResults.getBytes()),
  38.     new ByteArrayInputStream(
  39.     ResourceLoader.getResource(
  40.     "ParseResults.xsl",
  41.     requestSetting.getSiteSetting().getEncoding()
  42.     ).getBytes()
  43.     )
  44.     );
  45.  
  46.         msg = new ParseXMLwithStylesheet().getResult(
  47.     new ByteArrayInputStream(msg.getBytes()),
  48.     new ByteArrayInputStream(
  49.     ResourceLoader.getResource(
  50.     "Results2HTML.xsl",
  51.     requestSetting.getSiteSetting().getEncoding()
  52.     ).getBytes()
  53.     )
  54.     );
  55.     }catch(Exception e){
  56.         msg = "Exception: in FillFormService.getHTML(), msg: "+e.getLocalizedMessage();
  57.         System.out.println(msg);
  58.         e.printStackTrace();
  59.         log.error(msg, e);
  60.     }
  61.     return msg;
  62.     }
...................................

1. ParseFormDefResults.xsl
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8" ?> 
  2. - <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xalan="http://xml.apache.org/xslt">
  3. <xslutput method="xml" encoding="UTF-8" omit-xml-declaration="yes" indent="yes" cdata-section-elements="description" /> 
  4. - <!-- 
  5. This stylesheet generates xml of the form:
  6. <FIELDS>
  7. <FIELD pushmail="0" type="13" description="News" publicField="0">
  8. <FIELDALIAS>TESTTESTTEST</FIELDALIAS> 
  9. <VALUES>
  10. <VALUE category="News">Finance</VALUE> 
  11. <VALUE category="News">News</VALUE> 
  12. <VALUE category="Dette er en test">TESTTEST1</VALUE> 
  13. <VALUE category="Dette er en test">test2</VALUE> 
  14. <VALUE category="Dette er en test">TESTTEST3</VALUE> 
  15. <VALUE category="Dette er en test">test4</VALUE> 
  16. </VALUES>
  17. </FIELD>
  18. </FIELDS>
  19.  
  20.  
  21. --> 
  22. - <xsl:template match="/">
  23. - <submission>
  24. - <FIELDS>
  25. - <xsl:for-each select="//field[.//input[@type='radio' or @type='checkbox']]">
  26. - <FIELD>
  27. - <FIELDALIAS>
  28. <xsl:value-of select="@alias" /> 
  29. </FIELDALIAS>
  30. - <description>
  31. <xsl:value-of select="./description" /> 
  32. </description>
  33. - <VALUES>
  34. - <xsl:for-each select=".//input">
  35. - <xsl:if test="@value[.!='']">
  36. - <VALUE>
  37. <xsl:value-of select="@value" /> 
  38. </VALUE>
  39. </xsl:if>
  40. </xsl:for-each>
  41. </VALUES>
  42. </FIELD>
  43. </xsl:for-each>
  44. </FIELDS>
  45. </submission>
  46. </xsl:template>
  47. </xsl:stylesheet>
-------------------------------------
2.. ParseResults.xsl

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8" ?> 
  2. - <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xalan="http://xml.apache.org/xslt">
  3. <xslutput method="xml" encoding="UTF-8" omit-xml-declaration="no" indent="yes" cdata-section-elements="description" /> 
  4. - <xsl:template match="/">
  5. - <fields>
  6. - <xsl:for-each select="//submission[1]/FIELDS">
  7. - <xsl:for-each select=".//FIELD">
  8. - <field>
  9. - <xsl:attribute name="alias">
  10. <xsl:value-of select=".//FIELDALIAS" /> 
  11. </xsl:attribute>
  12. - <xsl:for-each select=".//VALUE">
  13. - <xsl:call-template name="count">
  14. <xsl:with-param name="value" select="." /> 
  15. <xsl:with-param name="alias" select="ancestor::FIELD/FIELDALIAS" /> 
  16. </xsl:call-template>
  17. </xsl:for-each>
  18. - <description>
  19. <xsl:value-of select="./description" /> 
  20. </description>
  21. </field>
  22. </xsl:for-each>
  23. </xsl:for-each>
  24. </fields>
  25. </xsl:template>
  26. - <xsl:template name="count">
  27. <xslaram name="value" /> 
  28. <xslaram name="alias" /> 
  29. - <value>
  30. - <xsl:attribute name="name">
  31. <xsl:value-of select="." /> 
  32. </xsl:attribute>
  33. - <!-- 
  34. The -1 at the end compensates for the extra field inserted so it is possible to see values and
  35. or fields that has not been submitted
  36.  
  37. --> 
  38. - <xsl:attribute name="count">
  39. <xsl:value-of select="count(//FIELDS[FIELD[FIELDALIAS[.=$alias]]//VALUE[.=$value]])-1" /> 
  40. </xsl:attribute>
  41. </value>
  42. </xsl:template>
  43. </xsl:stylesheet>
-----------------------------
3. Results2HTML.xsl

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8" ?> 
  2. - <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xalan="http://xml.apache.org/xslt">
  3.   <xsl:output method="html" encoding="UTF-8" omit-xml-declaration="yes" indent="yes" /> 
  4. - <!--         This stylesheet parses xml of the form:
  5.  
  6.         <fields>
  7.           <field alias="">
  8.             <value name="Finance" count="1" />
  9.             <value name="News" count="1" />
  10.             <value name="TESTTEST1" count="1" />
  11.             <value name="test2" count="1" />
  12.             <value name="TESTTEST3" count="1" />
  13.             <value name="test4" count="1" />
  14.           </field>
  15.           <field alias="">
  16.             <value name="Finance" count="5" />
  17.             <value name="News" count="5" />
  18.             <value name="test1" count="5" />
  19.             <value name="test2" count="5" />
  20.             <value name="test3" count="5" />
  21.             <value name="test5" count="1" />
  22.             <value name="test4" count="4" />
  23.         </field>
  24.  
  25.   --> 
  26. - <xsl:template match="/">
  27. - <table class="FFQuickPollResultsTable">
  28. - <xsl:for-each select="//field">
  29. - <tr>
  30. - <td colspan="4" class="FFQuickPollResultsTableFieldDescriptionRow">
  31.   <xsl:value-of select="./description" /> 
  32.   </td>
  33.   </tr>
  34. - <xsl:call-template name="genline">
  35. - <xsl:with-param name="countall">
  36.   <xsl:value-of select="sum(./value/@count)" /> 
  37.   </xsl:with-param>
  38. - <xsl:with-param name="max">
  39. - <!--  Find the max number for reference for the bars 
  40.   --> 
  41. - <xsl:for-each select="./value">
  42.   <xsl:sort select="@count" data-type="number" order="descending" /> 
  43. - <xsl:if test="position() = 1">
  44.   <xsl:value-of select="number(@count)" /> 
  45.   </xsl:if>
  46.   </xsl:for-each>
  47.   </xsl:with-param>
  48.   </xsl:call-template>
  49.   </xsl:for-each>
  50.   </table>
  51.   </xsl:template>
  52. - <xsl:template name="genline">
  53.   <xsl:param name="countall" /> 
  54.   <xsl:param name="max" /> 
  55. - <xsl:for-each select="value">
  56. - <tr>
  57. - <!--  Print the title 
  58.   --> 
  59. - <td class="FFQuickPollResultsTableColl1">
  60.   <xsl:value-of select="@name" /> 
  61.   </td>
  62. - <!--  Print the count 
  63.   --> 
  64. - <td class="FFQuickPollResultsTableColl2">
  65.   <xsl:value-of select="@count" /> 
  66.   <xsl:text>of</xsl:text> 
  67.   <xsl:value-of select="$countall" /> 
  68.   </td>
  69. - <!--  Print the bar representing the percent 
  70.   --> 
  71. - <td class="FFQuickPollResultsTableColl3">
  72. - <span class="FFQuickPollResultsBar">
  73. - <xsl:attribute name="style">
  74.   <xsl:text>width:</xsl:text> 
  75. - <xsl:if test="$countall!=0">
  76.   <xsl:value-of select="((@count div $countall) div ($max div $countall)) * 100" /> 
  77.   </xsl:if>
  78. - <xsl:if test="$countall=0">
  79.   <xsl:text>0</xsl:text> 
  80.   </xsl:if>
  81.   <xsl:text>%</xsl:text> 
  82.   </xsl:attribute>
  83.   </span>
  84.   </td>
  85. - <!--  Print the percentage nr. 
  86.   --> 
  87. - <td class="FFQuickPollResultsTableColl4">
  88. - <xsl:if test="$countall!=0">
  89.   <xsl:value-of select="round((@count div $countall) * 100)" /> 
  90.   </xsl:if>
  91. - <xsl:if test="$countall=0">
  92.   <xsl:text>0</xsl:text> 
  93.   </xsl:if>
  94.   <xsl:text>%</xsl:text> 
  95.   </td>
  96.   </tr>
  97.   </xsl:for-each>
  98.   </xsl:template>
  99.   </xsl:stylesheet>
May 15 '07 #5
Welcome to TheScripts TSDN....


Please post your XML and XSL code.
It sounds like a syntax error in XSL.
Hi Dorinbogdan,
How are you? Have you looked at the XSL code which I posted? Did you find anything wrong , please let me know , I am getting very frustrated with this problem..Actually I had solved it on development server and testing server but when it concerns with real time web server, i got the same exception!! ;-( please help me out ..

Thnaks
Prashant..
Jun 7 '07 #6
dorinbogdan
839 Expert 512MB
Hi,

Please forgive me, I forgot about your problem.
I hope to find few time today to overview the code (it looks quite ample).

Please post the FormDef.xml too.
And tell me what XSL throws the exception? (it seems that you posted 3 XSL files).

Thanks,
Dorin.
Jun 7 '07 #7
dorinbogdan
839 Expert 512MB
Hi,

Do you have the XML file, or a part of it?
I would test the XSL against XML, without java code.

Thanks,
Dorin.
Jun 8 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Taare | last post by:
Hi, I got <xsl:output method="html" encoding="iso-8859-1" doctype-public="-//W3C//DTD HTML 4.01//EN" doctype-system=" http://www.w3.org/TR/html4/strict.dtd"/> in my XSLT file. This should remove...
0
by: Jay Allard | last post by:
Hello I posted this in the vb.net group on the 2/25/2004, but didn't get any response. Here's attempt 2. Does anyone know of a more appropriate place to post this? One new piece of...
12
by: Keith Chadwick | last post by:
I have a fairly hefty XSLT file that for the sake of debugging and clarity I wish to split into some separate sub-templates contained within the same file. The master template calls an...
0
by: Christopher M. Lauer | last post by:
I have done my best to answer this question but can not find the proper set of commands. I would like to transform an xml file (in code behind) and display its output in a specific html tag,...
3
by: Teksure | last post by:
Hi group, searching in the Internet I found two products for XML which incorporate a very robust debugger for XSL/XSLT, I would like you to see these products and then, give me your opinion about...
7
by: One Handed Man \( OHM - Terry Burns \) | last post by:
I've been battling with this stupid problem for hours now. WebApp: Trying to do a simple transformation using XSLT to a Web Page, but it just failes without an error message ( In other words,...
2
by: Scamjunk | last post by:
I have been desperately looking for a treeview-type solution for my problem for the past three weeks and have been greatly unsuccessful. I am totally new to the world of XSLT and I *don't know*...
2
by: ranadhirnag | last post by:
We test a particular constriant in our XSLT and throw a custom exception on failure: <xsl:when test="......"> <xsl:value-of select="exception:throwException('Recording failed')"/> </xsl:when> ...
2
by: Piotr | last post by:
Hello, i got a problem with my hosting provider and the system admin seems not to be a top class specialist... I'm not one myself though. The problem is related to XSLT support in php....
0
by: ManWithNoName | last post by:
The following question is related to this thread: XSLT, document() function, filename, read non-standard/English characters (like µ) I have a XML file with a non-English character in its name...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.