]> granicus.if.org Git - docbook-dsssl/commitdiff
Fix nesting bug in XHTML
authorNorman Walsh <ndw@nwalsh.com>
Thu, 21 Mar 2002 13:27:51 +0000 (13:27 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Thu, 21 Mar 2002 13:27:51 +0000 (13:27 +0000)
xsl/extensions/saxon643/.classes/Makefile.common
xsl/extensions/saxon643/com/nwalsh/saxon/CalloutEmitter.java
xsl/extensions/saxon643/com/nwalsh/saxon/NumberLinesEmitter.java

index 06c8a992f0713ac3677a5365094c40893b8e9e4e..823b819ab1d5d3e640f60137a1135814296ae3f7 100644 (file)
@@ -1,4 +1,4 @@
-CLASSPATH=$(CLASSBASE):/usr/local/java/saxon-6.4.3/saxon.jar
+CLASSPATH=$(CLASSBASE):/usr/local/java/saxon-6.4.4/saxon.jar
 
 all: $(CLASSFILES)
        -@for f in $(SUBDIRS); do \
index 5a038d74619c12f7b06496abe0f08110b5f6f959..60492b06c52463a83c4f1c95109804cdc82e3b20 100644 (file)
@@ -57,6 +57,9 @@ public class CalloutEmitter extends CopyEmitter {
   /** The FO namespace name. */
   protected static String foURI = "http://www.w3.org/1999/XSL/Format";
 
+  /** The XHTML namespace name. */
+  protected static String xhURI = "http://www.w3.org/1999/xhtml";
+
   /** The default column for callouts that specify only a line. */
   protected int defaultColumn = 60;
 
@@ -413,15 +416,20 @@ public class CalloutEmitter extends CopyEmitter {
    * @return True if the element is the outer-most block, false otherwise.
    */
   protected boolean skipThisElement(int nameCode) {
+    // FIXME: This is such a gross hack...
     if (firstElement) {
       int thisFingerprint    = namePool.getFingerprint(nameCode);
       int foBlockFingerprint = namePool.getFingerprint(foURI, "block");
       int htmlPreFingerprint = namePool.getFingerprint("", "pre");
       int htmlDivFingerprint = namePool.getFingerprint("", "div");
+      int xhtmlPreFingerprint = namePool.getFingerprint(xhURI, "pre");
+      int xhtmlDivFingerprint = namePool.getFingerprint(xhURI, "div");
 
       if ((foStylesheet && thisFingerprint == foBlockFingerprint)
          || (!foStylesheet && (thisFingerprint == htmlPreFingerprint
-                               || thisFingerprint == htmlDivFingerprint))) {
+                               || thisFingerprint == htmlDivFingerprint
+                               || thisFingerprint == xhtmlPreFingerprint
+                               || thisFingerprint == xhtmlDivFingerprint))) {
        // Don't push the outer-most wrapping div, pre, or fo:block
        return true;
       }
index 4c041d9423935f0b22f3ed7010a0fafee52d43ea..9d7466c54e9ea65a833b1af0c9b4b04cf0b3a193 100644 (file)
@@ -60,6 +60,9 @@ public class NumberLinesEmitter extends CopyEmitter {
   /** The FO namespace name. */
   protected static String foURI = "http://www.w3.org/1999/XSL/Format";
 
+  /** The XHTML namespace name. */
+  protected static String xhURI = "http://www.w3.org/1999/xhtml";
+
   /** Every <code>modulus</code> line will be numbered. */
   protected int modulus = 5;
 
@@ -264,15 +267,20 @@ public class NumberLinesEmitter extends CopyEmitter {
    * @return True if the element is the outer-most block, false otherwise.
    */
   protected boolean skipThisElement(int nameCode) {
+    // FIXME: This is such a gross hack...
     if (firstElement) {
       int thisFingerprint    = namePool.getFingerprint(nameCode);
       int foBlockFingerprint = namePool.getFingerprint(foURI, "block");
       int htmlPreFingerprint = namePool.getFingerprint("", "pre");
       int htmlDivFingerprint = namePool.getFingerprint("", "div");
+      int xhtmlPreFingerprint = namePool.getFingerprint(xhURI, "pre");
+      int xhtmlDivFingerprint = namePool.getFingerprint(xhURI, "div");
 
       if ((foStylesheet && thisFingerprint == foBlockFingerprint)
          || (!foStylesheet && (thisFingerprint == htmlPreFingerprint
-                               || thisFingerprint == htmlDivFingerprint))) {
+                               || thisFingerprint == htmlDivFingerprint
+                               || thisFingerprint == xhtmlPreFingerprint
+                               || thisFingerprint == xhtmlDivFingerprint))) {
        // Don't push the outer-most wrapping div, pre, or fo:block
        return true;
       }