]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
FOP-2362: Using Saxon to intermediate format throws NullPointerException
authorSimon Steiner <ssteiner@apache.org>
Tue, 10 Jan 2017 10:33:41 +0000 (10:33 +0000)
committerSimon Steiner <ssteiner@apache.org>
Tue, 10 Jan 2017 10:33:41 +0000 (10:33 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1778105 13f79535-47bb-0310-9956-ffa450edef68

13 files changed:
fop-core/src/main/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMap.java
fop-core/src/main/java/org/apache/fop/render/afp/extensions/AFPInvokeMediumMap.java
fop-core/src/main/java/org/apache/fop/render/afp/extensions/AFPPageOverlay.java
fop-core/src/main/java/org/apache/fop/render/afp/extensions/AFPPageSegmentElement.java
fop-core/src/main/java/org/apache/fop/render/afp/extensions/AFPPageSetup.java
fop-core/src/main/java/org/apache/fop/render/intermediate/IFSerializer.java
fop-core/src/main/java/org/apache/fop/render/intermediate/extensions/GoToXYAction.java
fop-core/src/main/java/org/apache/fop/render/intermediate/extensions/URIAction.java
fop-core/src/main/java/org/apache/fop/render/pdf/extensions/PDFDictionaryAttachment.java
fop-core/src/main/java/org/apache/fop/render/pdf/extensions/PDFEmbeddedFileAttachment.java
fop-core/src/main/java/org/apache/fop/render/ps/extensions/PSSetPageDevice.java
fop-core/src/main/java/org/apache/fop/render/ps/extensions/PSSetupCode.java
fop-core/src/main/java/org/apache/fop/tools/fontlist/FontListSerializer.java

index 824ecbabb2985c213aed2e8eeb699515fea3f6d5..56a483ff9cc095a263d6c9ef4e3984d71f23c1cd 100644 (file)
@@ -68,10 +68,10 @@ public class AFPIncludeFormMap extends AFPExtensionAttachment {
     public void toSAX(ContentHandler handler) throws SAXException {
         AttributesImpl atts = new AttributesImpl();
         if (name != null && name.length() > 0) {
-            atts.addAttribute(null, ATT_NAME, ATT_NAME, "CDATA", name);
+            atts.addAttribute("", ATT_NAME, ATT_NAME, "CDATA", name);
         }
         if (this.src != null) {
-            atts.addAttribute(null, ATT_SRC, ATT_SRC, "CDATA", this.src.toASCIIString());
+            atts.addAttribute("", ATT_SRC, ATT_SRC, "CDATA", this.src.toASCIIString());
         }
         handler.startElement(CATEGORY, elementName, elementName, atts);
         handler.endElement(CATEGORY, elementName, elementName);
index 83c5325aa53f822618c3ea3b2cbc77f7d3abc4e0..92548246c1c86dd91fc4449c6e0b867c091f74a4 100644 (file)
@@ -41,7 +41,7 @@ public class AFPInvokeMediumMap extends AFPExtensionAttachment {
     public void toSAX(ContentHandler handler) throws SAXException {
         AttributesImpl atts = new AttributesImpl();
         if (name != null && name.length() > 0) {
-            atts.addAttribute(null, ATT_NAME, ATT_NAME, "CDATA", name);
+            atts.addAttribute("", ATT_NAME, ATT_NAME, "CDATA", name);
         }
         handler.startElement(CATEGORY, elementName, elementName, atts);
         handler.endElement(CATEGORY, elementName, elementName);
index 49fdf38edee1f5f5bf0a11663d6c9a09c0739a1f..7af76b649062a778a94f87bab5a4160145589422 100644 (file)
@@ -89,7 +89,7 @@ public class AFPPageOverlay extends AFPExtensionAttachment {
     public void toSAX(ContentHandler handler) throws SAXException {
         AttributesImpl atts = new AttributesImpl();
         if (name != null && name.length() > 0) {
-            atts.addAttribute(null, ATT_NAME, ATT_NAME, "CDATA", name);
+            atts.addAttribute("", ATT_NAME, ATT_NAME, "CDATA", name);
         }
         handler.startElement(CATEGORY, elementName, elementName, atts);
         handler.endElement(CATEGORY, elementName, elementName);
index f7379e02c2e55150e663d77d4130cb2ce55b17f4..1925e1456a45b4d970fa4743295f72575a857faf 100644 (file)
@@ -117,14 +117,14 @@ public class AFPPageSegmentElement extends AFPPageSetupElement {
         public void toSAX(ContentHandler handler) throws SAXException {
             AttributesImpl atts = new AttributesImpl();
             if (name != null && name.length() > 0) {
-                atts.addAttribute(null, ATT_NAME, ATT_NAME, "CDATA", name);
+                atts.addAttribute("", ATT_NAME, ATT_NAME, "CDATA", name);
             }
             if (value != null && value.length() > 0) {
-                atts.addAttribute(null, ATT_VALUE, ATT_VALUE, "CDATA", value);
+                atts.addAttribute("", ATT_VALUE, ATT_VALUE, "CDATA", value);
             }
 
             if (resourceSrc != null && resourceSrc.length() > 0) {
-                atts.addAttribute(null, ATT_RESOURCE_SRC, ATT_RESOURCE_SRC, "CDATA", resourceSrc);
+                atts.addAttribute("", ATT_RESOURCE_SRC, ATT_RESOURCE_SRC, "CDATA", resourceSrc);
             }
 
             handler.startElement(CATEGORY, elementName, elementName, atts);
index 12ca5ef3865c070b26ab6be2452fe5eac4661ed0..047d000128934206ea52b927451ef64cbfbfc6e7 100644 (file)
@@ -138,16 +138,16 @@ public class AFPPageSetup extends AFPExtensionAttachment {
     public void toSAX(ContentHandler handler) throws SAXException {
         AttributesImpl atts = new AttributesImpl();
         if (name != null && name.length() > 0) {
-            atts.addAttribute(null, ATT_NAME, ATT_NAME, "CDATA", name);
+            atts.addAttribute("", ATT_NAME, ATT_NAME, "CDATA", name);
         }
         if (value != null && value.length() > 0) {
-            atts.addAttribute(null, ATT_VALUE, ATT_VALUE, "CDATA", value);
+            atts.addAttribute("", ATT_VALUE, ATT_VALUE, "CDATA", value);
         }
         if (this.placement != ExtensionPlacement.DEFAULT) {
-            atts.addAttribute(null, ATT_PLACEMENT, ATT_PLACEMENT, "CDATA", placement.getXMLValue());
+            atts.addAttribute("", ATT_PLACEMENT, ATT_PLACEMENT, "CDATA", placement.getXMLValue());
         }
         if (encoding != TagLogicalElement.State.ENCODING_NONE) {
-            atts.addAttribute(null, ATT_ENCODING, ATT_ENCODING, "CDATA", String.valueOf(encoding));
+            atts.addAttribute("", ATT_ENCODING, ATT_ENCODING, "CDATA", String.valueOf(encoding));
         }
         handler.startElement(CATEGORY, elementName, elementName, atts);
         if (content != null && content.length() > 0) {
index eb8c4bc2f4618eb92890acc20655ec76eef4b6c5..5ea07b330a6e8b78f61b55052b3a2c3771828dfc 100644 (file)
@@ -841,7 +841,7 @@ implements IFConstants, IFPainter, IFDocumentNavigationHandler {
         noteAction(destination.getAction());
 
         AttributesImpl atts = new AttributesImpl();
-        atts.addAttribute(null, "name", "name", XMLConstants.CDATA, destination.getName());
+        atts.addAttribute("", "name", "name", XMLConstants.CDATA, destination.getName());
         try {
             handler.startElement(DocumentNavigationExtensionConstants.NAMED_DESTINATION, atts);
             serializeXMLizable(destination.getAction());
@@ -872,8 +872,8 @@ implements IFConstants, IFPainter, IFDocumentNavigationHandler {
         noteAction(bookmark.getAction());
 
         AttributesImpl atts = new AttributesImpl();
-        atts.addAttribute(null, "title", "title", XMLUtil.CDATA, bookmark.getTitle());
-        atts.addAttribute(null, "starting-state", "starting-state",
+        atts.addAttribute("", "title", "title", XMLUtil.CDATA, bookmark.getTitle());
+        atts.addAttribute("", "starting-state", "starting-state",
                 XMLUtil.CDATA, bookmark.isShown() ? "show" : "hide");
         handler.startElement(DocumentNavigationExtensionConstants.BOOKMARK, atts);
         serializeXMLizable(bookmark.getAction());
@@ -891,7 +891,7 @@ implements IFConstants, IFPainter, IFDocumentNavigationHandler {
         noteAction(link.getAction());
 
         AttributesImpl atts = new AttributesImpl();
-        atts.addAttribute(null, "rect", "rect",
+        atts.addAttribute("", "rect", "rect",
                 XMLConstants.CDATA, IFUtil.toString(link.getTargetRect()));
         if (getUserAgent().isAccessibilityEnabled()) {
             addStructRefAttribute(atts,
index 4bd548c73ba41230e6e79fddc18a9a2d5079298b..06dc4a5a757b178c45272a8e4c60d9075d20c157 100644 (file)
@@ -144,15 +144,15 @@ public class GoToXYAction extends AbstractAction implements DocumentNavigationEx
         AttributesImpl atts = new AttributesImpl();
         if (this.isCompleteExceptTargetLocation()) {
             final Point reportedTargetLocation = this.getTargetLocation();
-            atts.addAttribute(null, "id", "id", XMLUtil.CDATA, getID());
-            atts.addAttribute(null, "page-index", "page-index",
+            atts.addAttribute("", "id", "id", XMLUtil.CDATA, getID());
+            atts.addAttribute("", "page-index", "page-index",
                     XMLUtil.CDATA, Integer.toString(pageIndex));
-            atts.addAttribute(null, "x", "x", XMLUtil.CDATA,
+            atts.addAttribute("", "x", "x", XMLUtil.CDATA,
                     Integer.toString(reportedTargetLocation.x));
-            atts.addAttribute(null, "y", "y", XMLUtil.CDATA,
+            atts.addAttribute("", "y", "y", XMLUtil.CDATA,
                     Integer.toString(reportedTargetLocation.y));
         } else {
-            atts.addAttribute(null, "idref", "idref", XMLUtil.CDATA, getID());
+            atts.addAttribute("", "idref", "idref", XMLUtil.CDATA, getID());
         }
         handler.startElement(GOTO_XY.getNamespaceURI(),
                 GOTO_XY.getLocalName(), GOTO_XY.getQName(), atts);
index 22e7a270c1e89b1117acfe291251f17b24b9d62d..45e7563b22b933090319381b7e808a71f578a016 100644 (file)
@@ -90,11 +90,11 @@ public class URIAction extends AbstractAction implements DocumentNavigationExten
     public void toSAX(ContentHandler handler) throws SAXException {
         AttributesImpl atts = new AttributesImpl();
         if (hasID()) {
-            atts.addAttribute(null, "id", "id", XMLUtil.CDATA, getID());
+            atts.addAttribute("", "id", "id", XMLUtil.CDATA, getID());
         }
-        atts.addAttribute(null, "uri", "uri", XMLUtil.CDATA, getURI());
+        atts.addAttribute("", "uri", "uri", XMLUtil.CDATA, getURI());
         if (isNewWindow()) {
-            atts.addAttribute(null, "show-destination", "show-destination", XMLUtil.CDATA, "new");
+            atts.addAttribute("", "show-destination", "show-destination", XMLUtil.CDATA, "new");
         }
         handler.startElement(GOTO_URI.getNamespaceURI(),
                 GOTO_URI.getLocalName(), GOTO_URI.getQName(), atts);
index 3832619ba98db101cb6a6c969b13738506a0f727..e275bfbdc0f878ab6bed158079381da86b3308a0 100644 (file)
@@ -113,26 +113,26 @@ public class PDFDictionaryAttachment extends PDFExtensionAttachment {
             String idName = PDFDictionaryElement.ATT_ID;
             String id = dictionary.getProperty(PDFDictionaryExtension.PROPERTY_ID);
             if (id != null) {
-                attributes.addAttribute(null, idName, idName, "ID", id);
+                attributes.addAttribute("", idName, idName, "ID", id);
             }
         }
         if (type == PDFDictionaryType.Action) {
             String actionTypeName = PDFActionElement.ATT_TYPE;
             String actionType = dictionary.getProperty(PDFActionExtension.PROPERTY_TYPE);
             if (actionType != null) {
-                attributes.addAttribute(null, actionTypeName, actionTypeName, "CDATA", actionType);
+                attributes.addAttribute("", actionTypeName, actionTypeName, "CDATA", actionType);
             }
         } else if (type == PDFDictionaryType.Page) {
             String pageNumbersName = PDFPageExtension.PROPERTY_PAGE_NUMBERS;
             String pageNumbers = dictionary.getProperty(pageNumbersName);
             if (pageNumbers != null) {
-                attributes.addAttribute(null, pageNumbersName, pageNumbersName, "CDATA", pageNumbers);
+                attributes.addAttribute("", pageNumbersName, pageNumbersName, "CDATA", pageNumbers);
             }
         } else if (type == PDFDictionaryType.Dictionary) {
             String keyName = PDFCollectionEntryElement.ATT_KEY;
             String key = dictionary.getKey();
             if (key != null) {
-                attributes.addAttribute(null, keyName, keyName, "CDATA", key);
+                attributes.addAttribute("", keyName, keyName, "CDATA", key);
             }
         }
         return attributes;
@@ -142,7 +142,7 @@ public class PDFDictionaryAttachment extends PDFExtensionAttachment {
         String keyName = PDFCollectionEntryExtension.PROPERTY_KEY;
         String key = array.getKey();
         if (key != null) {
-            attributes.addAttribute(null, keyName, keyName, "CDATA", key);
+            attributes.addAttribute("", keyName, keyName, "CDATA", key);
         }
         return attributes;
     }
@@ -151,13 +151,13 @@ public class PDFDictionaryAttachment extends PDFExtensionAttachment {
         String keyName = PDFCollectionEntryElement.ATT_KEY;
         String key = entry.getKey();
         if (key != null) {
-            attributes.addAttribute(null, keyName, keyName, "CDATA", key);
+            attributes.addAttribute("", keyName, keyName, "CDATA", key);
         }
         if (entry instanceof PDFReferenceExtension) {
             String refid = ((PDFReferenceExtension) entry).getReferenceId();
             if (refid != null) {
                 String refidName = PDFReferenceElement.ATT_REFID;
-                attributes.addAttribute(null, refidName, refidName, "IDREF", refid);
+                attributes.addAttribute("", refidName, refidName, "IDREF", refid);
             }
         }
         return attributes;
index 8a6e76ba92173ccab08f36c481e2204077292799..96e429d6940f1552e5d42f847c7a6b25d39fabb9 100644 (file)
@@ -140,13 +140,13 @@ public class PDFEmbeddedFileAttachment extends PDFExtensionAttachment {
     public void toSAX(ContentHandler handler) throws SAXException {
         AttributesImpl atts = new AttributesImpl();
         if (filename != null && filename.length() > 0) {
-            atts.addAttribute(null, ATT_NAME, ATT_NAME, "CDATA", filename);
+            atts.addAttribute("", ATT_NAME, ATT_NAME, "CDATA", filename);
         }
         if (src != null && src.length() > 0) {
-            atts.addAttribute(null, ATT_SRC, ATT_SRC, "CDATA", src);
+            atts.addAttribute("", ATT_SRC, ATT_SRC, "CDATA", src);
         }
         if (desc != null && desc.length() > 0) {
-            atts.addAttribute(null, ATT_DESC, ATT_DESC, "CDATA", desc);
+            atts.addAttribute("", ATT_DESC, ATT_DESC, "CDATA", desc);
         }
         String element = getElement();
         handler.startElement(CATEGORY, element, element, atts);
index b463fc3d506bcf0bc2d3f49a729afa5f35efa21d..791c793d6de3e88d63e318d1933672496fa3e258 100644 (file)
@@ -101,7 +101,7 @@ public class PSSetPageDevice extends PSExtensionAttachment {
     public void toSAX(ContentHandler handler) throws SAXException {
         AttributesImpl atts = new AttributesImpl();
         if (name != null && name.length() > 0) {
-            atts.addAttribute(null, ATT_NAME, ATT_NAME, "CDATA", name);
+            atts.addAttribute("", ATT_NAME, ATT_NAME, "CDATA", name);
         }
         String element = getElement();
         handler.startElement(CATEGORY, element, element, atts);
index f2d580582b2833ad7d4829a9aa697bab9b2fe7ab..08d3cf485904f1c5effb4f5c7ebbe58edb82f49c 100644 (file)
@@ -90,7 +90,7 @@ public class PSSetupCode extends PSExtensionAttachment {
     public void toSAX(ContentHandler handler) throws SAXException {
         AttributesImpl atts = new AttributesImpl();
         if (name != null && name.length() > 0) {
-            atts.addAttribute(null, ATT_NAME, ATT_NAME, "CDATA", name);
+            atts.addAttribute("", ATT_NAME, ATT_NAME, "CDATA", name);
         }
         String element = getElement();
         handler.startElement(CATEGORY, element, element, atts);
index 931cf6c2863fc4d6b6326673d1d2026ff0fd2601..26f4fadbd648e6bf288e5e8139c4ad2b29a27760 100644 (file)
@@ -83,8 +83,8 @@ public class FontListSerializer {
                 continue;
             }
             atts.clear();
-            atts.addAttribute(null, NAME, NAME, CDATA, familyName);
-            atts.addAttribute(null, STRIPPED_NAME, STRIPPED_NAME, CDATA,
+            atts.addAttribute("", NAME, NAME, CDATA, familyName);
+            atts.addAttribute("", STRIPPED_NAME, STRIPPED_NAME, CDATA,
                     stripQuotes(familyName));
             handler.startElement(FAMILY, atts);
 
@@ -109,8 +109,8 @@ public class FontListSerializer {
         for (Object container : containers) {
             FontSpec cont = (FontSpec) container;
             atts.clear();
-            atts.addAttribute(null, KEY, KEY, CDATA, cont.getKey());
-            atts.addAttribute(null, TYPE, TYPE, CDATA,
+            atts.addAttribute("", KEY, KEY, CDATA, cont.getKey());
+            atts.addAttribute("", TYPE, TYPE, CDATA,
                     cont.getFontMetrics().getFontType().getName());
             handler.startElement(FONT, atts);
             generateXMLForTriplets(handler, cont.getTriplets());
@@ -126,9 +126,9 @@ public class FontListSerializer {
         for (Object triplet1 : triplets) {
             FontTriplet triplet = (FontTriplet) triplet1;
             atts.clear();
-            atts.addAttribute(null, NAME, NAME, CDATA, triplet.getName());
-            atts.addAttribute(null, STYLE, STYLE, CDATA, triplet.getStyle());
-            atts.addAttribute(null, WEIGHT, WEIGHT, CDATA,
+            atts.addAttribute("", NAME, NAME, CDATA, triplet.getName());
+            atts.addAttribute("", STYLE, STYLE, CDATA, triplet.getStyle());
+            atts.addAttribute("", WEIGHT, WEIGHT, CDATA,
                     Integer.toString(triplet.getWeight()));
             handler.element(TRIPLET, atts);
         }