XDK9.2.0.2, pb with JAXP and XSL Processor

Hello,
I'm using XDK 9.2.0.2 and I try to use JAXP.
I have a difference between using the Oracle XSL processor directly and through JAXP.
Through JAXP, the processor don't care about the xsl:outpout encoding attribute !
Why ?
It take care of method, indent, ... but not encoding !
I try to set the property with : transformer.setOutputProperty(OutputKeys.ENCODING, "iso-8859-1");
It works but I don't want to do that this way !
TIA
Didier
sample (from XSLSample2):
/* $Header: XSLSample2.java 07-jan-2002.02:24:56 sasriniv Exp $ */
/* Copyright (c) 2000, 2002, Oracle Corporation. All rights reserved. */
* DESCRIPTION
* This file gives a simple example of how to use the XSL processing
* capabilities of the Oracle XML Parser V2.0. An input XML document is
* transformed using a given input stylesheet
* This Sample streams the result of XSL transfromations directly to
* a stream, hence can support xsl:output features.
import java.net.URL;
import oracle.xml.parser.v2.DOMParser;
import oracle.xml.parser.v2.XMLDocument;
import oracle.xml.parser.v2.XMLDocumentFragment;
import oracle.xml.parser.v2.XSLStylesheet;
import oracle.xml.parser.v2.XSLProcessor;
// Import JAXP
import javax.xml.transform.*;
import javax.xml.transform.dom.*;
import javax.xml.transform.stream.*;
public class XSLSample2
* Transforms an xml document using a stylesheet
* @param args input xml and xml documents
public static void main (String args[]) throws Exception
DOMParser parser;
XMLDocument xml, xsldoc, out;
URL xslURL;
URL xmlURL;
try
if (args.length != 2)
// Must pass in the names of the XSL and XML files
System.err.println("Usage: java XSLSample2 xslfile xmlfile");
System.exit(1);
// Parse xsl and xml documents
parser = new DOMParser();
parser.setPreserveWhitespace(true);
// parser input XSL file
xslURL = DemoUtil.createURL(args[0]);
parser.parse(xslURL);
xsldoc = parser.getDocument();
// parser input XML file
xmlURL = DemoUtil.createURL(args[1]);
parser.parse(xmlURL);
xml = parser.getDocument();
// instantiate a stylesheet
XSLProcessor processor = new XSLProcessor();
processor.setBaseURL(xslURL);
XSLStylesheet xsl = processor.newXSLStylesheet(xsldoc);
// display any warnings that may occur
processor.showWarnings(true);
processor.setErrorStream(System.err);
// Process XSL
processor.processXSL(xsl, xml, System.out);
// With JAXP
System.out.println("");
System.out.println("With JAXP :");
TransformerFactory tfactory = TransformerFactory.newInstance();
String xslID = xslURL.toString();
Transformer transformer = tfactory.newTransformer(new StreamSource(xslID));
//transformer.setOutputProperty(OutputKeys.ENCODING, "iso-8859-1");
String xmlID = xmlURL.toString();
StreamSource source = new StreamSource(xmlID);
transformer.transform(source, new StreamResult(System.out));
catch (Exception e)
e.printStackTrace();
My XML file :
<?xml version="1.0" encoding="ISO-8859-1"?>
<ListePatients>
<Patient>
<Nom>Zeublouse</Nom>
<NomMarital/>
<Prinom>Agathe</Prinom>
</Patient>
<Patient>
<Nom>Stick</Nom>
<NomMarital>Laiboul</NomMarital>
<Prinom>Ella</Prinom>
</Patient>
<Patient>
<Nom>`ihnotvy</Nom>
<NomMarital/>
<Prinom>Jacques</Prinom>
</Patient>
</ListePatients>
my XSL file :
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" omit-xml-declaration="yes" indent="yes" encoding="ISO-8859-1"/>
<xsl:template match="*|/"><xsl:apply-templates/></xsl:template>
<xsl:template match="text()|@*"><xsl:value-of select="."/></xsl:template>
<xsl:template match="/">
<HTML>
<HEAD>
<TITLE>Liste de patients</TITLE>
</HEAD>
<BODY>
<xsl:apply-templates select='ListePatients'/>
</BODY>
</HTML>
</xsl:template>
<xsl:template match='ListePatients'>
<TABLE>
<xsl:for-each select='Patient'>
<xsl:sort select='Nom' order='ascending' data-type='text'/>
<TR TITLE='`ihnotvy'>
<TD><xsl:value-of select='Nom'/></TD>
<TD><xsl:value-of select='NomMarital'/></TD>
<TD><xsl:value-of select='Prinom'/></TD>
</TR>
</xsl:for-each>
</TABLE>
</xsl:template>
</xsl:stylesheet>
The result :
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<TITLE>Liste de patients</TITLE>
</HEAD>
<BODY>
<TABLE>
<TR TITLE="`ihnotvy">
<TD>`ihnotvy</TD>
<TD></TD>
<TD>Jacques</TD>
</TR>
<TR TITLE="`ihnotvy">
<TD>Stick</TD>
<TD>Laiboul</TD>
<TD>Ella</TD>
</TR>
<TR TITLE="`ihnotvy">
<TD>Zeublouse</TD>
<TD></TD>
<TD>Agathe</TD>
</TR>
</TABLE>
</BODY>
</HTML>
With JAXP :
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>Liste de patients</TITLE>
</HEAD>
<BODY>
<TABLE>
<TR TITLE="C C)C(C.C/C4C6C9">
<TD>C C)C(C.C/C4C6C9</TD>
<TD></TD>
<TD>Jacques</TD>
</TR>
<TR TITLE="C C)C(C.C/C4C6C9">
<TD>Stick</TD>
<TD>Laiboul</TD>
<TD>Ella</TD>
</TR>
<TR TITLE="C C)C(C.C/C4C6C9">
<TD>Zeublouse</TD>
<TD></TD>
<TD>Agathe</TD>
</TR>
</TABLE>
</BODY>
</HTML>

You can also use a PrintWriter to wrap a JspWriter
since PrintWriter has a constructor that takes any
Writer instance.I'm having the same problem, I've spent a lot of time
on it but I can't get it work.
Could you post some working code that shows how you
can do it?
Thanks.
It works now, I have used the code:
result = processor.processXSL(stylesheet, xml);
PrintWriter pw = new PrintWriter(out);
result.print(pw);
I had tried this before but there was an error in other place that prevented it to work.
Thank you anyway.

Similar Messages

  • Problem with getLastChild() and xsl:comment / nodes

    Hi list,
    the problem I'm facing at the moment is as follows (using org.w3c.dom.*):
    in my DOM I have fragments of the following:
                    <a accesskey="2" class="namedanchor" name="content">
                        <!---->
                        <span class="test">.</span>
                    </a>in my program my code looks like this:
    while(current.getLastChild() != null)
                        current = current.getLastChild();suppose the node "current" is the anchor node in the above example (with sub nodes: <xsl:comment /> written as <!---->, a span node with attribute class and attribute value "test" and this span node has a childnode - a textnode with the value ".")
    If the while loop has the current node being the anchor node it doesn't proceed - it ends up in the anchor node itself, but it should end up in text node with value ".".
    Does anyone have a clue whats the problem with the <xsl:comment /> in this case??
    thanks for your help
    HTH
    silentium

    The last child of that <a> element (that's what you meant by "anchor node", right?) is a white-space text node. Regardless of whether any of its earlier children happen to be comments. (And even though I couldn't understand all that hand-waving about <!> versus <xsl:comment>.)

  • XMLTABLE() with XSQL and XSL

    HI Gentlemen,
    I have an XMLTYPE table with data loaded in it, which I would like to query with JDeveloper, formatted. For normal relational tables it works fine. However, for an XMLTYPE table, where--in addition--XMLTABLE() must be involved, I only get the constant text portions, not the selected values. (Note that the same works with XML instances file and XSL stylesheet excellently, without JDeveloper.) My question is: How can I reference a coulumn in an XMLTABLE() table that is constructed during query?
    Included is the following:
    (1) XSQL file in JDeveloper
    (2) XSL stylesheet file in JDeveloper
    (3) Output of XSQL from JDeveloper when the <?xml-stylesheet...> is commented out
    Please help if you have an idea.
    (1) XSQL file under public-html
    <?xml version="1.0" encoding='windows-1252'?>
    <?xml-stylesheet type="text/xsl" href="untitled1.xsl" ?>
    <page xmlns:xsql="urn:oracle-xsql" connection="gksconnection">
    <xsql:query xmlns:xsql="urn:oracle-xsql" >
    SELECT
    des.ziffer,
    des.kap_bez,
    des.bereich,
    des.kapitel,
    des.abschnitt,
    des.kurztext,
    des.langtext,
    des.quittungstext
    FROM
    z p,
    XMLTable(XMLNAMESPACES('urn:ehd/001' as "n1", 'urn:ehd/go/001' as "n2"),
                        'for $i in /n1:ehd
    where $i/n1:header/n1:provider/n1:organization/n1:id/@EX eq "46" and
                        $i/n1:body/n2:gnr_liste/n2:gnr/@V eq "01700V"
                   return $i/n1:body/n2:gnr_liste/n2:gnr[@V="01700V"]'
    PASSING p.xml_document
    COLUMNS
    ziffer      VARCHAR2(12) PATH '@V',
    kap_bez VARCHAR2(255) PATH 'n2:allgemein/n2:legende/n2:kap_bez/@DN',
    bereich VARCHAR2(255) PATH 'n2:allgemein/n2:legende/n2:kap_bez/n2:bereich/@DN',
    kapitel VARCHAR2(255) PATH 'n2:allgemein/n2:legende/n2:kap_bez/n2:kapitel/@DN',
    abschnitt VARCHAR2(255) PATH 'n2:allgemein/n2:legende/n2:kap_bez/n2:abschnitt/@DN',
    kurztext      VARCHAR2(255) PATH 'n2:allgemein/n2:legende/n2:kurztext/@V',
    langtext      VARCHAR2(255) PATH 'n2:allgemein/n2:legende/n2:langtext/@V',
    quittungstext VARCHAR2(255) PATH 'n2:allgemein/n2:legende/n2:quittungstext/@V') des
    <!-- select * from z -->
    </xsql:query>
    </page>
    (2) XSL stylesheet under public-html
    <?xml version="1.0" encoding="windows-1252" ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:ehd="urn:ehd/001" xmlns:pe="urn:ehd/go/001">
    <xsl:output encoding="ISO-8859-1" method="text/html" />
    <xsl:template match="/page">
    <html>
    <head>
    <title>EBM Ziffer</title>
    </head>
    <body style="font-family:verdana;color:black">
    <h2><xsl:text>Ziffer: </xsl:text>
    <xsl:value-of select="@V"/>
    </h2>
    <table border="1">
    <tr>
    <td><xsl:text>Gültigkeit</xsl:text></td>
    <td><xsl:value-of select="pe:allgemein/pe:gueltigkeit/pe:service_tmr/@V"/></td>
    </tr>
    <tr>
    <td><xsl:text>Bezeichnung Kapitel</xsl:text></td>
    <td><xsl:value-of select="pe:allgemein/pe:legende/pe:kap_bez/@V"/>
    <xsl:text> </xsl:text>
    <xsl:value-of select="pe:allgemein/pe:legende/pe:kap_bez/@DN"/></td>
    </tr>
    <tr>
    <td><xsl:text>Bereich</xsl:text></td>
    <td><xsl:value-of select="pe:allgemein/pe:legende/pe:kap_bez/pe:bereich/@V"/>
    <xsl:text> </xsl:text>
    <xsl:value-of select="pe:allgemein/pe:legende/pe:kap_bez/pe:bereich/@DN"/></td>
    </tr>
    <tr>
    <td><xsl:text>Kapitel</xsl:text></td>
    <td><xsl:value-of select="pe:allgemein/pe:legende/pe:kap_bez/pe:kapitel/@V"/>
    <xsl:text> </xsl:text>
    <xsl:value-of select="pe:allgemein/pe:legende/pe:kap_bez/pe:kapitel/@DN"/></td>
    </tr>
    <tr>
    <td><xsl:text>Abschnitt</xsl:text></td>
    <td><xsl:value-of select="pe:allgemein/pe:legende/pe:kap_bez/pe:abschnitt/@DN"/></td>
    </tr>
    <tr>
    <td><xsl:text>Unterabschnitt</xsl:text></td>
    <td><xsl:value-of select="pe:allgemein/pe:legende/pe:kap_bez/pe:uabschnitt/@DN"/></td>
    </tr>
    <tr>
    <td><xsl:text>Block</xsl:text></td>
    <td><xsl:value-of select="pe:allgemein/pe:legende/pe:kap_bez/pe:block/@DN"/></td>
    </tr>
    <tr>
    <td><xsl:text>Kurztext</xsl:text></td>
    <td><xsl:value-of select="pe:allgemein/pe:legende/pe:kurztext/@V"/></td>
    </tr>
    <tr>
    <td><xsl:text>Langtext</xsl:text></td>
    <td><xsl:value-of select="pe:allgemein/pe:legende/pe:langtext/@V"/></td>
    </tr>
    <tr>
    <td><xsl:text>Langtext (Fortsetzung)</xsl:text></td>
    <td><xsl:value-of select="pe:allgemein/pe:legende/pe:langtext_continued/@V"/></td>
    </tr>
    <tr>
    <td><xsl:text>Quittungstext</xsl:text></td>
    <td><xsl:value-of select="pe:allgemein/pe:legende/pe:quittungstext/@V"/></td>
    </tr>
    </table>
    <!-- Anmerkungen-Liste -->
    <h3><xsl:text>Anmerkungen</xsl:text></h3>
    <table border="1">
    <xsl:for-each select="pe:allgemein/pe:anmerkungen_liste/pe:anmerkung">
    <tr>
    <td><xsl:value-of select="@V"/></td>
    </tr>
    </xsl:for-each>
    </table>
    <!-- Leistungsinhalt-->
    <h3><xsl:text>Leistungsinhalt</xsl:text></h3>
    <table border="1" >
    <tr>
    <th><xsl:text>Komplex</xsl:text></th>
    <th><xsl:text>Leistung</xsl:text></th>
    </tr>
    <xsl:for-each select="pe:allgemein/pe:leistungsinhalt/pe:komplex">
    <tr>
    <td><xsl:value-of select="@V"/></td>
    <td>
    <xsl:for-each select="pe:leistung">
    <xsl:value-of select="@V"/>
    </xsl:for-each>
    </td>
    </tr>
    </xsl:for-each>
    </table>
    <!-- Bewertungsliste -->
    <h3><xsl:text>Bewertungen</xsl:text></h3>
    <table border="1">
    <tr>
    <th><xsl:text>Bewertung</xsl:text></th>
    <th><xsl:text>Einheit</xsl:text></th>
    <th><xsl:text>Gebührenordnung</xsl:text></th>
    <th><xsl:text>Leistungserbringerart</xsl:text></th>
    <th><xsl:text>Leistungstyp</xsl:text></th>
    <th><xsl:text>Versorgungsgebiet</xsl:text></th>
    </tr>
    <xsl:for-each select="pe:allgemein/pe:bewertung_liste/pe:bewertung">
    <tr>
    <td><xsl:value-of select="@V"/></td>
    <td><xsl:value-of select="@U"/></td>
    <td><xsl:value-of select="pe:gebuehrenordnung/@V"/></td>
    <td><xsl:value-of select="pe:leistungserbringerart/@V"/></td>
    <td><xsl:value-of select="pe:leistung_typ/@V"/></td>
    <td><xsl:value-of select="pe:versorgungsgebiet/@V"/></td>
    </tr>
    </xsl:for-each>
    </table>
    <!-- Zeitbedarfliste -->
    <h3><xsl:text>Zeitbedarfliste</xsl:text></h3>
    <table border="1">
    <tr>
    <th><xsl:text>Zeit</xsl:text></th>
    <th><xsl:text>Einheit</xsl:text></th>
    <th><xsl:text>Leistungstyp</xsl:text></th>
    </tr>
    <xsl:for-each select="pe:allgemein/pe:zeitbedarf_liste/pe:zeit">
    <tr>
    <td><xsl:value-of select="@V"/></td>
    <td><xsl:value-of select="@U"/></td>
    <td><xsl:value-of select="pe:leistung_typ/@V"/></td>
    </tr>
    </xsl:for-each>
    </table>
    <!-- Prüfzeit -->
    <h3><xsl:text>Prüfzeit</xsl:text></h3>
    <table border="1">
    <tr>
    <th><xsl:text>Zeitangabe</xsl:text></th>
    <th><xsl:text>Zeiteinheit</xsl:text></th>
    <th><xsl:text>Profiltyp</xsl:text></th>
    </tr>
    <tr>
    <td><xsl:value-of select="pe:allgemein/pe:pruefzeit/@V"/></td>
    <td><xsl:value-of select="pe:allgemein/pe:pruefzeit/@U"/></td>
    <td><xsl:value-of select="pe:allgemein/pe:pruefzeit/pe:zeitprofilart/@V"/></td>
    </tr>
    </table>
    <!-- RLV -->
    <h3><xsl:text>RLV</xsl:text></h3>
    <table border="1">
    <tr>
    <th><xsl:text>Kennzeichen</xsl:text></th>
    </tr>
    <tr>
    <td><xsl:value-of select="pe:allgemein/pe:rlv/@V"/></td>
    </tr>
    </table>
    <!-- Leistungsgruppe -->
    <h3><xsl:text>Leistungsgruppe</xsl:text></h3>
    <table border="1">
    <tr>
    <th><xsl:text>Code</xsl:text></th>
    </tr>
    <tr>
    <td><xsl:value-of select="pe:allgemein/pe:leistungsgruppe/@V"/></td>
    </tr>
    </table>
    <!-- Fachgruppen-Liste -->
    <h3><xsl:text>Fachgruppen</xsl:text></h3>
    <table border="1">
    <tr>
    <th><xsl:text>Versorgungsbereich</xsl:text></th>
    <th><xsl:text>Fachgruppe</xsl:text></th>
    </tr>
    <xsl:for-each select="pe:bedingung/pe:fachgruppe_liste/pe:versorgungsbereich">
    <tr>
    <td><xsl:value-of select="@V"/></td>
    <td>
    <xsl:for-each select="pe:fachgruppe">
    <xsl:value-of select="@V"/>
    </xsl:for-each>
    </td>
    </tr>
    </xsl:for-each>
    </table>
    <!-- Ausschlußiste -->
    <h3><xsl:text>Ausschlußliste</xsl:text></h3>
    <table border="1" >
    <tr>
    <th><xsl:text>Bezugsraum</xsl:text></th>
    <th><xsl:text>Ziffer</xsl:text></th>
    </tr>
    <xsl:for-each select="pe:regel/pe:ausschluss_liste/pe:bezugsraum">
    <tr>
    <td><xsl:value-of select="@U"/></td>
    <td>
    <xsl:for-each select="pe:gnr_liste/pe:gnr">
    <xsl:value-of select="@V"/>
    </xsl:for-each>
    </td>
    </tr>
    </xsl:for-each>
    </table>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>
    (3) XSQL output without stylesheet
    -<page>
    −<ROWSET>
    −<ROW num="1">
    <ZIFFER>01700V</ZIFFER>
    −<KAP_BEZ>
    Gesundheits- und Früherkennungsuntersuchungen, Mutterschaftsvorsorge, Empfängnisregelun g und Schwangerschaftsabbruch (vormals Sonstige Hilfen)
    </KAP_BEZ>
    <BEREICH>Arztgruppenübergreifende allgemeine Leistungen</BEREICH>
    <KAPITEL>Allgemeine Leistungen</KAPITEL>
    −<ABSCHNITT>
    Gesundheits- und Früherkennungsuntersuchungen, Mutterschaftsvorsorge, Empfängnisregel ung und Schwangerschaftsabbruch (vormals Sonstige Hilfen)
    </ABSCHNITT>
    −<KURZTEXT>
    Grundpauschale für Fachärzte für Laboratoriumsmedizin u.a.
    </KURZTEXT>
    −<LANGTEXT>
    Grundpauschale für Fachärzte für Laboratoriumsmedizin, Mikrobiologie und Infektionsepidemiologi e, Transfusionsmedizin und ermächtigte Fachwissenschaftler der Medizin für die Erbringung von Laborleistungen gemäß den Richtlinien des Gemeinsamen Bundesauss
    </LANGTEXT>
    −<QUITTUNGSTEXT>
    Grundpauschale für Fachärzte für Laboratoriumsmedizin u.a.
    </QUITTUNGSTEXT>
    </ROW>
    </ROWSET>
    </page>
    Please apologize that the stylesheet has considerably more than the XSQL query--this is going to be extended when the technique works.
    Thank you, kind regards
    Miklos HERBOLY

    Perhaps you could consider using the XMLType instead of varchar2 for the db columns, thus avoiding use of XMLTABLE() altogether.
    Consult for example the source code of :
    http://www.amazon.com/Oracle-XSQL-Combining-Publish-Dynamic/dp/0471271209
    You might also try posting to a more specialized forum such as:
    http://forums.oracle.com/forums/category.jspa?categoryID=51
    NA
    http://nickaiva.blogspot.com
    Edited by: Nick Aiva on Jan 21, 2011 9:17 PM

  • Generating PDF with XML and XSL

    Hi, quick basic question...
    I'm trying to generate pdf doc from xml with xsl.
    I'm using following sample code from xml.apache.org
    response.setContentType("application/pdf");
    Driver driver =new Driver();
    driver.setOutputStream(response.getOutputStream());
    driver.setRenderer(Driver.RENDER_PDF);
    Transformer transformer=TransformerFactory.newInstance()
    .newTransformer(new StreamSource("foo.xsl"));
    transformer.transform(xmlsource, new SAXResult(driver.getContentHandler()));
    xmlSource is my regular xml that wants to be pdf.
    is foo.xsl any regular xsl that I use to coonvert xml into html?
    or is it some special xsl that is tailored for pdf.
    Is this what is called xsl-fo?
    Thanks
    IL

    Hi IL,
    XSLT can translate XML to something else. It is most suited to transforming to another tree-like format (XML, HTML, etc.) but can be 'asked' to produce other kinds of output, flat text for example.
    It is driven by an XSL file which is a series of patterns to match and output to produce.
    This XSL file can be used to generate another XML document in which the nodes come from the Formatting Object namespace. These describe, in generic terms the format of an output document based upon the contents of the original XML.
    The formatting object XML document can then be used as input to a formatting object XML processor which can generate PDF output from it.
    You may want to check out:
    www.w3c.org
    for all the stuff on XML, XSL, XSLT, Formatting Objects, etc., and:
    xml.apache.org
    for imformation on Xalan, which is an XSL processor and FOP, which is a formatting object processor.
    Hope that helps,
    Peter.

  • JSP and XSL Processor - How do you send the processed file to a JSPWriter?

    The hierarchy for the relevant I/O classes is:
    Object---OutputStream
    Object---Writer---PrintWriter
    Object---Writer---JspWriter
    For the processed file from the Oracle XSLProcessor, typically HTML, the XSLProcessor API v2.0.2.9 offers either 'OutputStream' or 'PrintWriter' as targets.
    Unfortunately, a 'PrintWriter' cannot be used as a 'JspWriter'.
    I realise that I can call
    HttpServletResponse.getOutputStream()/getWriter() but there may be problems using this with the 'out' object.
    According to the JSP documentation: 'Either getOutputStream() or getWriter() may be called to write the body, not both.'
    The XSLProcessor API does offer an 'XMLDocumentFragment' as another target so I can make an XML document from this but looking at the API for 'XMLDocument', this again only offers 'OutputStream', 'PrintDriver' or 'PrintWriter' as targets.
    Not sure if 'PrintDriver' helps.
    How do I send the output from the 'XSLProcessor' to a 'JspWriter'?
    Why does the API not offer a 'Writer' as a target?
    Polite observation - this would be consistent with the 'OutputStream' being offered and, if changed, would not break any existing code.
    null

    You can also use a PrintWriter to wrap a JspWriter
    since PrintWriter has a constructor that takes any
    Writer instance.I'm having the same problem, I've spent a lot of time
    on it but I can't get it work.
    Could you post some working code that shows how you
    can do it?
    Thanks.
    It works now, I have used the code:
    result = processor.processXSL(stylesheet, xml);
    PrintWriter pw = new PrintWriter(out);
    result.print(pw);
    I had tried this before but there was an error in other place that prevented it to work.
    Thank you anyway.

  • Help with WindowsDesktopSSO and AMIdentity.getAttributes

    Hi guys and girls,
    I need some help from you experts.
    I successfully setup, thanks to this guide
    http://blogs.oracle.com/knittel/entry/opensso_windowsdesktopsso
    and a lot of trial & errors and googling a Kerberos authentication between OpenAM version 9.5.2 and an Active Directory Server.
    When I navigate to openAM page (from a domain machine) http://<openAMhost>:<port>/opensso, it doesn't ask for credentials ...
    and I can see, with ieHttpHeaders, kerberos data exchange.
    Without creating an Active Directory DataStore (pointing to the same domain where I use kerberos data) in openAM,
    when I navigate (from a domain machine) to /opensso/idm/EndUser page, it always gives me:
    "Plug-in com.sun.identity.idm.plugins.ldapv3.LDAPv3Repo encountered an ldap exception. LDAP Error 32: The entry specified in the request does not exist."
    Since my aim was to get user information from a web app ... I thought I could have done this with an agent/SDK call as I usually do with "classic" authentication.
    Now I created a J2EE Agent (on openAM) to protect one of my application deployed on a JBoss 4.2.1-GA server.
    Agent configured with default options and these changes:
    Agent Filter Mode: J2EE_POLICY
    User Mapping Mode: USER_ID
    User Attribute Name: tried both with employeenumber and uid
    User Principal Flag: enabled
    User Token Name: UserToken
    FQDN Check: tried both with enabled and disabled
    WebAuthentication Available : Enabled
    In my application WEB-INF/jboss-web.xml looks like this:
         <?xml version="1.0" encoding="UTF-8"?>
         <jboss-web>
              <security-domain>java:/jaas/AMRealm</security-domain>
         </jboss-web>Usually, when I authenticate with "classic" (internal datastore) login, I can get user attributes programmatically with a code like this:
           private String getCredenzialiUtente(HttpServletRequest request)
                String                 SSOUsername      = null;
                SSOToken               ssoToken      = null;
                SSOTokenManager        manager           = null;
                  try
                    manager = SSOTokenManager.getInstance();
                    if ( manager == null)
                         throw new RuntimeException("Unable to Get: SSOTokenManager");
                    String ssoTokenID = AmFilterManager.getAmSSOCache().getSSOTokenForUser(request);
                    ssoToken = manager.createSSOToken(ssoTokenID);
                    if ( ssoToken == null )
                          throw new RuntimeException("Unable to Get: TokenForUser");
                    AMIdentity amid = new AMIdentity(ssoToken);
                    if(amid == null)
                       throw new RuntimeException("Unable to Get: UserIdentity");
                    SSOUsername  = amid.getName();
                    System.out.println("######### USERNAME FROM SSO: " + SSOUsername);
                    Set<String> info = new HashSet<String>();
                    info.add("uid");
                    info.add("givenName");
                    java.util.Map mappa = amid.getAttributes(info);
                    if ( mappa != null )
                        java.util.Set insieme = mappa.keySet();
                        java.util.Iterator it = insieme.iterator();
                        while ( it.hasNext() )
                            String n = it.next().toString();
                            System.out.println( n + " ==> " + mappa.get(n) );
                    else
                        System.err.println(" DAMN - NO ATTR ");
              catch (Exception exception)
                exception.getMessage();
                exception.printStackTrace();
              System.out.println("OUT getCredenzialiUtente: " + SSOUsername);
              return SSOUsername;
            }        When I log to console with default "ldapService" module (outside the domain), I can get something like:
         2011-09-29 13:14:38,733 INFO  [STDOUT]  ####################################### USER = amadmin
         2011-09-29 13:15:32,250 INFO  [STDOUT] IN getCredenzialiLAit
         2011-09-29 13:15:32,260 INFO  [STDOUT] ######### USERNAME DA SSO: a2zarrillo
         2011-09-29 13:15:32,291 INFO  [STDOUT] uid ==> [a2zarrillo]
         2011-09-29 13:15:32,291 INFO  [STDOUT] givenName ==> [Antonio2]
         2011-09-29 13:15:32,311 INFO  [STDOUT] OUT getCredenziali: a2zarrillo
         2011-09-29 13:15:32,321 INFO  [STDOUT]  ####################################### USER = a2zarrillobut when i try to login from inside the domain (with kerberos, so no credentials) with a domain user, I get:
         2011-09-29 13:15:39,496 INFO  [STDOUT] IN getCredenzialiLAit
         2011-09-29 13:15:39,503 INFO  [STDOUT] ######### USERNAME DA SSO: tonyweb
         2011-09-29 13:15:39,550 ERROR [STDERR] Message:Plug-in  encountered an ldap exception.  LDAP Error 32: The entry specified in the request does not exist.
         2011-09-29 13:15:39,554 ERROR [STDERR]      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         2011-09-29 13:15:39,560 ERROR [STDERR]      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         2011-09-29 13:15:39,562 ERROR [STDERR]      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         2011-09-29 13:15:39,566 ERROR [STDERR]      at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
         2011-09-29 13:15:39,574 ERROR [STDERR]      at com.sun.identity.shared.jaxrpc.SOAPClient$SOAPContentHandler.createResourceBasedException(SOAPClient.java:834)
         2011-09-29 13:15:39,575 ERROR [STDERR]      at com.sun.identity.shared.jaxrpc.SOAPClient$SOAPContentHandler.endDocument(SOAPClient.java:800)
         2011-09-29 13:15:39,578 ERROR [STDERR]      at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Source)
         2011-09-29 13:15:39,582 ERROR [STDERR]      at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
         2011-09-29 13:15:39,587 ERROR [STDERR]      at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
         2011-09-29 13:15:39,592 ERROR [STDERR]      at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
         2011-09-29 13:15:39,598 ERROR [STDERR]      at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source)
         2011-09-29 13:15:39,600 ERROR [STDERR]      at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(Unknown Source)
         2011-09-29 13:15:39,604 ERROR [STDERR]      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
         2011-09-29 13:15:39,607 ERROR [STDERR]      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
         2011-09-29 13:15:39,609 ERROR [STDERR]      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
         2011-09-29 13:15:39,613 ERROR [STDERR]      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
         2011-09-29 13:15:39,616 ERROR [STDERR]      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
         2011-09-29 13:15:39,621 ERROR [STDERR]      at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
         2011-09-29 13:15:39,625 ERROR [STDERR]      at com.sun.identity.shared.jaxrpc.SOAPClient.send(SOAPClient.java:343)
         2011-09-29 13:15:39,633 ERROR [STDERR]      at com.sun.identity.shared.jaxrpc.SOAPClient.send(SOAPClient.java:311)
         2011-09-29 13:15:39,636 ERROR [STDERR]      at com.sun.identity.idm.remote.IdRemoteServicesImpl.getAttributes(IdRemoteServicesImpl.java:229)
         2011-09-29 13:15:39,639 ERROR [STDERR]      at com.sun.identity.idm.remote.IdRemoteCachedServicesImpl.getAttributes(IdRemoteCachedServicesImpl.java:402)
         2011-09-29 13:15:39,642 ERROR [STDERR]      at com.sun.identity.idm.AMIdentity.getAttributes(AMIdentity.java:344)
         2011-09-29 13:15:39,645 ERROR [STDERR]      at org.apache.jsp.MainPageJSP_jsp.getCredenzialiUtente(MainPageJSP_jsp.java:63)
         2011-09-29 13:15:39,648 ERROR [STDERR]      at org.apache.jsp.MainPageJSP_jsp._jspService(MainPageJSP_jsp.java:217)
         2011-09-29 13:15:39,653 ERROR [STDERR]      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
         2011-09-29 13:15:39,660 ERROR [STDERR]      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         2011-09-29 13:15:39,664 ERROR [STDERR]      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:387)
         2011-09-29 13:15:39,666 ERROR [STDERR]      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
         2011-09-29 13:15:39,669 ERROR [STDERR]      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
         2011-09-29 13:15:39,673 ERROR [STDERR]      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         2011-09-29 13:15:39,676 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
         2011-09-29 13:15:39,678 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         2011-09-29 13:15:39,683 ERROR [STDERR]      at com.sun.identity.agents.filter.AmAgentBaseFilter.allowRequestToContinue(AmAgentBaseFilter.java:127)
         2011-09-29 13:15:39,685 ERROR [STDERR]      at com.sun.identity.agents.filter.AmAgentBaseFilter.doFilter(AmAgentBaseFilter.java:76)
         2011-09-29 13:15:39,690 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         2011-09-29 13:15:39,697 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         2011-09-29 13:15:39,701 ERROR [STDERR]      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:687)
         2011-09-29 13:15:39,705 ERROR [STDERR]      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
         2011-09-29 13:15:39,710 ERROR [STDERR]      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
         2011-09-29 13:15:39,713 ERROR [STDERR]      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
         2011-09-29 13:15:39,716 ERROR [STDERR]      at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
         2011-09-29 13:15:39,725 ERROR [STDERR]      at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442)
         2011-09-29 13:15:39,729 ERROR [STDERR]      at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)
         2011-09-29 13:15:39,730 ERROR [STDERR]      at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:178)
         2011-09-29 13:15:39,734 ERROR [STDERR]      at com.cid.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:92)
         2011-09-29 13:15:39,741 ERROR [STDERR]      at com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.java:295)
         2011-09-29 13:15:39,744 ERROR [STDERR]      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
         2011-09-29 13:15:39,747 ERROR [STDERR]      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
         2011-09-29 13:15:39,750 ERROR [STDERR]      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
         2011-09-29 13:15:39,753 ERROR [STDERR]      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
         2011-09-29 13:15:39,761 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
         2011-09-29 13:15:39,765 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         2011-09-29 13:15:39,768 ERROR [STDERR]      at com.cid.faces.webapp.CidWebUIFilter._invokeDoFilter(CidWebUIFilter.java:239)
         2011-09-29 13:15:39,776 ERROR [STDERR]      at com.cid.faces.webapp.CidWebUIFilter._doFilterImpl(CidWebUIFilter.java:196)
         2011-09-29 13:15:39,780 ERROR [STDERR]      at com.cid.faces.webapp.CidWebUIFilter.doFilter(CidWebUIFilter.java:80)
         2011-09-29 13:15:39,788 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         2011-09-29 13:15:39,793 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         2011-09-29 13:15:39,797 ERROR [STDERR]      at com.sun.identity.agents.filter.AmAgentBaseFilter.allowRequestToContinue(AmAgentBaseFilter.java:127)
         2011-09-29 13:15:39,803 ERROR [STDERR]      at com.sun.identity.agents.filter.AmAgentBaseFilter.doFilter(AmAgentBaseFilter.java:76)
         2011-09-29 13:15:39,807 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         2011-09-29 13:15:39,810 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         2011-09-29 13:15:39,813 ERROR [STDERR]      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
         2011-09-29 13:15:39,820 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         2011-09-29 13:15:39,825 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         2011-09-29 13:15:39,829 ERROR [STDERR]      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
         2011-09-29 13:15:39,833 ERROR [STDERR]      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
         2011-09-29 13:15:39,836 ERROR [STDERR]      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
         2011-09-29 13:15:39,843 ERROR [STDERR]      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
         2011-09-29 13:15:39,846 ERROR [STDERR]      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
         2011-09-29 13:15:39,851 ERROR [STDERR]      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
         2011-09-29 13:15:39,854 ERROR [STDERR]      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
         2011-09-29 13:15:39,857 ERROR [STDERR]      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         2011-09-29 13:15:39,860 ERROR [STDERR]      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
         2011-09-29 13:15:39,862 ERROR [STDERR]      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
         2011-09-29 13:15:39,866 ERROR [STDERR]      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
         2011-09-29 13:15:39,870 ERROR [STDERR]      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
         2011-09-29 13:15:39,874 ERROR [STDERR]      at java.lang.Thread.run(Thread.java:619)
         2011-09-29 13:15:39,877 INFO  [STDOUT] OUT getCredenziali: tonywebAs you can see I'm using the "sample" agentApp.war.     
    What am I missing ? It "crashes" as for getAttributes() call :/
    I thought it could be because I didn't setup LDAP DataStore ... so I set up Active Directory Data Store.
    While in openAM console (from outside domain) I can see (from Subjects tab) Active Directory users and relative information
    (like FirstName (=givenName), Surname (=sn), Full Name (=cn), etc.) ... when I try again with idm/EndUser (from a domain machine)
    I get the same error:
         Message:Plug-in  encountered an ldap exception.  LDAP Error 32: The entry specified in the request does not exist.What should I do now ?
    If you need more clarifications ... just ask :)
    Thank you in advance and sorry for the big post.
    Best Regards,
    Tony
    P.D. By the way, my OpenAM configuration does not create any "amAuthWindowsDesktopSSO.log" :(
    I setup, from opensso/Debug.jsp message level for Authentication ... but it still doesn't create this log ... can you please tell me how to let openAM write it ?
    Again thank you

    Weird enough, changing to ADAM data store (and not "standard" AD datastore) solved the problem :D
    I still wonder why since both plugins share the same java [implementing] class...
    Regards,
    Tony

  • Parser-independent document creation with JAXP?

    Is it possible to do the following in a parser-independent
    way with JAXP apis? Thanks
    DOMImplementation domImpl =
    new org.apache.xerces.dom.DOMImplementationImpl();
    org.apache.xerces.dom.DocumentTypeImpl docTypeImpl
    = new org.apache.xerces.dom.DocumentTypeImpl(null, "bean", null, null);
    docTypeImpl.setInternalSubset(
    "<!ELEMENT bean (property*)>" + NL +
    "<!ELEMENT property (#PCDATA)>" + Format.NL +
    "<!ATTLIST bean className CDATA #REQUIRED>" + NL +
    "<!ATTLIST property type CDATA #REQUIRED>" + NL +
    "<!ATTLIST property name CDATA #REQUIRED>"
    Document doc = domImpl.createDocument(null, "bean", docTypeImpl);
    Element root = doc.getDocumentElement();
    // add elements etc.

    Hi,
    Its is possible thru the following code.
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    dbf.setValidating(true);
    dbf.setNamespaceAware(true);
    DocumentBuilder db = dbf.newDocumentBuilder();
    DOMImplementation domImpl = db.getDOMImplementation();
    DocumentType docType = domImpl.createDocumentType("PERSON",null,strSystemID);
    document = domImpl.createDocument(null,"STUDENT",docType);and use the javax.xml.transformer api to transform this in memory java dom object to xml.
    Regards / Rajan Kumar

  • How to comment/uncomment section of XML file with JAXP?

    Hi,
    I need to periodically under some condition, comment or uncomment a section of my XML file. I want to know is there a way that I can do it with JAXP?
    I am using JDK 1.5
    Thanks,

    Hi Sachi,
    >>Now I have to pupulate flat file where 1st row of the file should always be field names.
    Duplicate the target node and map you field names to the first instance and the mapping logic to the next instance
    eg:
    Suppose your target structure is:
    -root
    -->Details
    >FName
    >LName
    Do a Mapping like this:
    -root
    -->Details
    ><FName>FName </FName>
    ><LName>LName </LName>
    -->Details (use mapping logic hereafter)
    ><FName>
    ><LName>
    Regards
    Suraj

  • Error when I replaced  the DOM parcer with JAXP

    I replaced the DOM parcer with JAXP ....
    We moved from DOM parcer �import org.apache.xerces.parsers.DOMParser;� to JAXP.
    Here is my code:
    // Step 1: create a DocumentBuilderFactory and setNamespaceAware
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    // Step 2: create a DocumentBuilder
      DocumentBuilder db = dbf.newDocumentBuilder();
    // Step 3: parse the input file to get a Document object
    Document doc = db.parse(location);
      root = doc.getDocumentElement();
      root.normalize();
    AND when we run stress test after a while we start getting error
    java.lang.NullPointerException
    at org.apache.xerces.dom.DeepNodeListImpl.nextMatchingElementAfter(Unknown Source)
    at org.apache.xerces.dom.DeepNodeListImpl.item(Unknown Source)
    at org.apache.xerces.dom.DeepNodeListImpl.getLength(Unknown Source)
    at com.xxx.yyy.WfStartTasksXmlDAO.getActionPerformed(Unknown Source)
    at com.xxx.yyy.WfStartTasksXmlDAO.getAction(Unknown Source)
    - Any idea why we are getting this error. Is this server (Linux) problem? or JAXP?
    Message was edited by:
    TamerBasha

    This is happening because JAXP is not thread safe. need to synchronize bracket or use thread safe parser.

  • Getting started with Java and XML

    Hi,
    Although I am pretty familiar with Java, I am a total newbie with using it to parse XML. I have been reading quite a few tutorials so am getting a good understanding of it and am thinking of using the DOM model for my purposes.
    What I haven't been able to find, however, is how I can actually get started with this. I have tried compiling a few examples and have been getting errors such as:
    xmltest.java package javax.xml.parsers does not exist
    xmltest.java package org.w3c.dom does not existetc etc...
    It looks like these packages don't come with J2SE. Can anyone confirm this? Do I need to download and install the Java Web Services Developer Pack to solve this problem?
    Finally, I know I will need an XML parser but have read that JDK 1.4 has it's own parser (Crimson). Is this adequate for parsing XML files or will I also need a parser such as Xerces?
    Thanks so much for any help!

    Hi DrClap,
    Thanks for the reply. I have JDK 1.4.1_02 installed on my server but the following error keeps coming up when I try to run my example:
    Exception in thread "main" java.lang.NoClassDefFoundError: org/w3c/dom/NodeAre there any further packages I need to download in order to run Java with XML? I have read some people install JAXP and XERCES... are these necessary for parsing an XML document or should J2SE 1.4.1 be sufficient?
    Thanks for your help!
    Jill

  • Oddity with JAXP HTML DOM

    Ok heres the idea. For this web app I am supposed to be finding locations in a web page by letting a user "step" his way through. Basically, you highlight a section of text, I take the node you highlighted and walk backwards and up through the tree until I hit the root. Then I turn around and show you all the steps I take. Then I follow the steps all the way back down (its supposed to show people how DOM tree's work).
    To debug this I made a simple little tool that highlights what node we are on and around it shows all its siblings so I can watch the program step its way backwards and forwards through the tree.
    Anyway, the issue is that I can get up to the Body tag easily enough (which because it is unique in the page is as high as I need to climb, I can just use GetTags By name to get the body tag again) but when I try to turn around and go back down the tree is different. When I go up on the top "level" of the tree there is only 2 nodes (HEAD and BODY) and there are 7 nodes in the next level down.
    When I walk down the tree there are 4 nodes in the top (HEAD BODY and 2 #text nodes, and the next level has 9 nodes, themselves plus 2 #text nodes.
    I don't get how this is happening. The page I am going up and down is exactly the same. I am using JAXP and HttpUnit and thats it. The page I am going up and down is saved and does not change at all between passed. How can there be differing numbers of nodes in places? Can anyone shed some light on why this could be happening

    Ok I want to make an addendum to my last post in the hope's someone can tell me what I'm doing wrong. I tried using the exact same file to go up and down (literally) rather than the one that had the highlighted section and getting the other page off its actual web site as I am supposed to do and it seems to work fine. I can only assume that there is something wrong with the way I am getting the file. I am using URLConnection to get a BufferedReader and reading the html file into a string. After I have finished adding whatever needs to ne added (so I know where the user highlighted I add a tag) I write it out to our local server as a temp file in plain text so HttpUnit can find it and build a DOM out of it.
    Is there something about the way I'm getting the html that might damage it somehow? Can anyone suggest a better way?
    Thanks

  • Is there a way to create a year at a glance with detail and print?

    Is there a way to create a year at a glance with detail and print?

    To do what Dave indicated you need to do, it depends on what version of Acrobat you have:
    Acrobat 8: Advanced > Enable Usage Rights in Adobe Reader
    Acrobat 9: Advanced > Extend Features in Adobe Reader
    Acrobat 10: File > Save As > Reader Extended PDF > Enable Additional Features
    Acrobat 11: File > Save as Other > Reader Extended PDF > Enable More Tools (includes form fill-in & save)
    I wonder what it will be next time?

  • I've just found that three movies I've bought from iTunes on on my iPad are not showing up on Apple TV or anywhere other than that iPad.  What's up with that and will I lose these films if I reset this iPad?

    I've just found that three movies I've bought from iTunes on on my iPad are not showing up on Apple TV or anywhere other than that iPad.  What's up with that and will I lose these films if I reset this iPad?

    Thanks.  The reason this has become an issue is that I recently bought a new Macbook Air that the iPad is not synced to.  The one is was synced to was stolen.  If I want to sync this iPad to the new Air, won't it be wiped before I'm able to copy these films or am I wrong about that?

  • Problem with xfce and/or mouse and keyboard

    Hi!
    Two days ago I've turned on my laptop with Arch and the display manager Slim has frozen immediately. Later on Single-User mode I've uninstalled it. Now in normal mode when I type "startxfce4" everything is showing up, but the mouse and keyboard don't work. I know it's not frozen, because animation of mouse and CPU Frequency Monitor is on.
    Strange fact is that laptop is not connecting with the Internet, so now I don't know where the problem is.
    It's happening when I start xfce both from user and super user.
    Just before those troubles I've updated everything with "pacman -Syu", but I haven't seen anything strange. Also the computer could have been roughly turned off (by unplugging power supply), when was turning on.
    Thanks,
    Gaba

    Sorry for not replying, but I didn't have access to my laptop by this time.
    On grub I have only normal mode and 'fallback' mode, so I have result from 'journalctl' from normal mode.
    I'm sending the fragment of this file where you can see everything after I typed 'startxfce4' in console:
    http://codepad.org/8pYIj8qC
    I see that something is wrong, but after some attempts I don't know how to fix this ^^
    Edit:
    Oh, I forgot to write, that I've tried activate some drivers from 'lspci -k' (there were no "Kernel driver in use:..." in almost every device), but it didn't fi anything.
    Last edited by gargoyle (2015-03-15 23:20:18)

  • Problem with JFrame and busy/wait Cursor

    Hi -- I'm trying to set a JFrame's cursor to be the busy cursor,
    for the duration of some operation (usually just a few seconds).
    I can get it to work in some situations, but not others.
    Timing does seem to be an issue.
    There are thousands of posts on the BugParade, but
    in general Sun indicates this is not a bug. I just need
    a work-around.
    I've written a test program below to demonstrate the problem.
    I have the problem on Solaris, running with both J2SE 1.3 and 1.4.
    I have not tested on Windows yet.
    When you run the following code, three JFrames will be opened,
    each with the same 5 buttons. The first "F1" listens to its own
    buttons, and works fine. The other two (F2 and F3) listen
    to each other's buttons.
    The "BUSY" button simply sets the cursor on its listener
    to the busy cursor. The "DONE" button sets it to the
    default cursor. These work fine.
    The "SLEEP" button sets the cursor, sleeps for 3 seconds,
    and sets it back. This does not work.
    The "INVOKE LATER" button does the same thing,
    except is uses invokeLater to sleep and set the
    cursor back. This also does not work.
    The "DELAY" button sleeps for 3 seconds (giving you
    time to move the mouse into the other (listerner's)
    window, and then it behaves just like the "SLEEP"
    button. This works.
    Any ideas would be appreciated, thanks.
    -J
    import java.awt.BorderLayout;
    import java.awt.Cursor;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.SwingUtilities;
    public class BusyFrameTest implements ActionListener
    private static Cursor busy = Cursor.getPredefinedCursor (Cursor.WAIT_CURSOR);
    private static Cursor done = Cursor.getDefaultCursor();
    JFrame frame;
    JButton[] buttons;
    public BusyFrameTest (String title)
    frame = new JFrame (title);
    buttons = new JButton[5];
    buttons[0] = new JButton ("BUSY");
    buttons[1] = new JButton ("DONE");
    buttons[2] = new JButton ("SLEEP");
    buttons[3] = new JButton ("INVOKE LATER");
    buttons[4] = new JButton ("DELAY");
    JPanel buttonPanel = new JPanel();
    for (int i = 0; i < buttons.length; i++)
    buttonPanel.add (buttons);
    frame.getContentPane().add (buttonPanel);
    frame.pack();
    frame.setVisible (true);
    public void addListeners (ActionListener listener)
    for (int i = 0; i < buttons.length; i++)
    buttons[i].addActionListener (listener);
    public void actionPerformed (ActionEvent e)
    System.out.print (frame.getTitle() + ": " + e.getActionCommand());
    if (e.getActionCommand().equals ("BUSY"))
    frame.setCursor (busy);
    else if (e.getActionCommand().equals ("DONE"))
    frame.setCursor (done);
    else if (e.getActionCommand().equals ("SLEEP"))
    frame.setCursor (busy);
    try { Thread.sleep (3000); } catch (Exception ex) { }
    frame.setCursor (done);
    System.out.print (" finished");
    else if (e.getActionCommand().equals ("INVOKE LATER"))
    frame.setCursor (busy);
    SwingUtilities.invokeLater (thread);
    else if (e.getActionCommand().equals ("DELAY"))
    try { Thread.sleep (3000); } catch (Exception ex) { }
    frame.setCursor (busy);
    try { Thread.sleep (3000); } catch (Exception ex) { }
    frame.setCursor (done);
    System.out.print (" finished");
    System.out.println();
    Runnable thread = new Runnable()
    public void run()
    try { Thread.sleep (3000); } catch (Exception ex) { }
    frame.setCursor (done);
    System.out.println (" finished");
    public static void main (String[] args)
    BusyFrameTest f1 = new BusyFrameTest ("F1");
    f1.addListeners (f1);
    BusyFrameTest f2 = new BusyFrameTest ("F2");
    BusyFrameTest f3 = new BusyFrameTest ("F3");
    f2.addListeners (f3); // 2 listens to 3
    f3.addListeners (f2); // 3 listens to 2

    I've had the same problems with cursors and repaints in a swing application, and I was thinking of if I could use invokeLater, but I never got that far with it.
    I still believe you would need a thread for the time consuming task, and that invokeLater is something you only need to use in a thread different from the event thread.

Maybe you are looking for

  • How do I use the restart keyboard combination on my MacBook Air without eject button?

    On my MacBook Air, I noticed that there are two restart combinations: 'Cmd+Ctrl+Power Button' force restarts my mac and 'Cmd+Ctrl+Eject' restarts my mac normally (not force restart). OS X: Keyboard shortcuts I noticed that there is no eject button on

  • Burning DVD from project in iMovie

    I am a beginner and have done my first project in iMovie with a size of 11,9 Gb. It is in iMovie just the way I want it with music and effects. I tried to burn it on a 4,7 Gb DVD and thought I could put in a new one when the first was filled up but i

  • Problem with .fla file opening in FC 5.5

    Hello. I'm fresh Flash Catalyst 5.5 user and I suppose I do something wrong. I tried to open .fla template simply by double-clicking it, but it is not recognized.  Then I tried to rightclick on it and choose 'open file with', but when I choose FC 5.5

  • How do I find and read mail messages on my SuperDuper backup?

    I have a new mbp and did not migrate anything from old mbp. I made a SuperDuper backup of old computer so I have data I may need. How do I find my mailboxes and be able to read messages that I need on my my backup. I know I could export mailboxes but

  • Character Set problem on Macintosh ...

    Hi everyone, I have a problem, on Macintosh only (I have not this problem on PC using the same code), when I retrieve a field of type VARCHAR2 (80), any accented characters are uploaded in their non-accented version. For instance characters 'é', 'è