You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Andreas Neumann <ne...@karto.baug.ethz.ch> on 2006/01/05 14:21:29 UTC

problem with error message nr 1, Content is not allowed in prolog

Hello,

I have a problem with error messages where I don't know how to 
avoid/correct them.

Maybe someone from the Batik developers could help me?

I am refering to the following (early) prototype:
http://www.carto.net/geofotos/index.svg

when I load the document I get the following error:
----------------------------------------------------
java.io.IOException: Content is not allowed in prolog.
         at 
org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown Source)
         at 
org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown Source)
         at 
org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown 
Source)
         at 
org.apache.batik.dom.svg.SAXSVGDocumentFactory.createSVGDocument(Unknown 
Source)
         at org.apache.batik.bridge.DocumentLoader.loadDocument(Unknown 
Source)
         at org.apache.batik.bridge.URIResolver.getNode(Unknown Source)
         at 
org.apache.batik.bridge.BridgeContext.getReferencedNode(Unknown Source)
         at 
org.apache.batik.bridge.BridgeContext.getReferencedElement(Unknown Source)
         at org.apache.batik.bridge.FontFace.getFontFamily(Unknown Source)
         at org.apache.batik.bridge.FontFace.getFontFamily(Unknown Source)
         at org.apache.batik.bridge.CSSFontFace.getFontFamily(Unknown 
Source)
         at 
org.apache.batik.bridge.SVGFontUtilities.getFontFamily(Unknown Source)
         at 
org.apache.batik.bridge.SVGTextElementBridge.getFontFamilyList(Unknown 
Source)
         at 
org.apache.batik.bridge.SVGTextElementBridge.getAttributeMap(Unknown Source)
         at 
org.apache.batik.bridge.SVGTextElementBridge.fillAttributedStringBuffer(Unknown 
Source)
         at 
org.apache.batik.bridge.SVGTextElementBridge.buildAttributedString(Unknown 
Source)
         at 
org.apache.batik.bridge.SVGTextElementBridge.computeLaidoutText(Unknown 
Source)
         at 
org.apache.batik.bridge.SVGTextElementBridge.buildGraphicsNode(Unknown 
Source)
         at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown 
Source)
         at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown 
Source)
         at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown 
Source)
         at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown 
Source)
         at org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
         at org.apache.batik.swing.svg.GVTTreeBuilder.run(Unknown Source)

--------------
I really don't know which of the files is meant. 
"http://www.carto.net/geofotos/index.svg" or the file 
"http://www.carto.net/geofotos/geophotos_map.xml" or another file loaded 
at the beginning?

What does it mean? A problem with encoding or the wrong UTF-8 header?

Thanks for any hint on the problem,
Andreas

-- 
----------------------------------------------
Andreas Neumann - Institute of Cartography
Swiss Federal Institute of Technology (ETH)
ETH Hoenggerberg
CH-8093  Zurich, Switzerland
Phone: ++41-1-633 3031, Fax: ++41-1-633 1153
e-mail: neumann@karto.baug.ethz.ch
www: http://www.carto.net/neumann/
SVG.Open: http://www.svgopen.org/
Carto.net: http://www.carto.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: problem with error message nr 1, Content is not allowed in prolog

Posted by Andreas Neumann <ne...@karto.baug.ethz.ch>.
yes, indeed that fixed the problem. Thank you very much!!!

I moved the CSS definitions from the internal file (index.svg) to an 
external css file and forgot to update the link. And I did not notice a 
font-rendering problem, since the same font is already installed within 
the system, so it seems like Batik would take the Cisalpin font from the 
system.

thomas.deweese@kodak.com wrote:
> Hi Andreas,
> 
>    The problem is your @font-face definition in the styles.css file:
> 
> @font-face  { 
>                  font-family:'Cisalpin LT Std';
>                  font-weight:normal;
>                  src:url('#CisalpinLTStd-Regular') format(svg) 
> }
> 
>    The src specification says to get the font from the element '
> CisalpinLTStd-Regular' in 
> the _CSS_ file (url resolution in style sheets is relative to the CSS 
> document not the document
> that referenced the CSS style sheet) as a result Batik tries to parse your 
> CSS style sheet as XML
> so it can find the requested element and this fails fairly badly ;)
> 
>    In this case you can either leave the src off completely, or it needs 
> to refer to 'index.svg#...' 
> or you could move the font into 'cisalpinLTStd.svg' and refer to it there. 
>  While Batik should
> support all of these, I am unsure of what Adobe will support...

ASV3 supports only internal svg font-definitions, but the change to

@font-face  {
                  font-family:'Cisalpin LT Std';
                  font-weight:normal;
                 src:url('index.svg#CisalpinLTStd-Regular') format(svg)
}

in the external CSS works in ASV3 as well.

ASV6 should also support SVG fonts in other svg files, but who knows if 
ASV6 will ever be deployed ;-( ...

Thanks again for your quick and competent help!

Andreas

-- 
----------------------------------------------
Andreas Neumann - Institute of Cartography
Swiss Federal Institute of Technology (ETH)
ETH Hoenggerberg
CH-8093  Zurich, Switzerland
Phone: ++41-1-633 3031, Fax: ++41-1-633 1153
e-mail: neumann@karto.baug.ethz.ch
www: http://www.carto.net/neumann/
SVG.Open: http://www.svgopen.org/
Carto.net: http://www.carto.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: problem with error message nr 1, Content is not allowed in prolog

Posted by th...@kodak.com.
Hi Andreas,

   The problem is your @font-face definition in the styles.css file:

@font-face  { 
                 font-family:'Cisalpin LT Std';
                 font-weight:normal;
                 src:url('#CisalpinLTStd-Regular') format(svg) 
}

   The src specification says to get the font from the element '
CisalpinLTStd-Regular' in 
the _CSS_ file (url resolution in style sheets is relative to the CSS 
document not the document
that referenced the CSS style sheet) as a result Batik tries to parse your 
CSS style sheet as XML
so it can find the requested element and this fails fairly badly ;)

   In this case you can either leave the src off completely, or it needs 
to refer to 'index.svg#...' 
or you could move the font into 'cisalpinLTStd.svg' and refer to it there. 
 While Batik should
support all of these, I am unsure of what Adobe will support...

Andreas Neumann <ne...@karto.baug.ethz.ch> wrote on 01/05/2006 08:21:29 
AM:

> Hello,
> 
> I have a problem with error messages where I don't know how to 
> avoid/correct them.
> 
> Maybe someone from the Batik developers could help me?
> 
> I am refering to the following (early) prototype:
> http://www.carto.net/geofotos/index.svg
> 
> when I load the document I get the following error:
> ----------------------------------------------------
> java.io.IOException: Content is not allowed in prolog.
>          at 
> org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown 
Source)
>          at 
> org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown 
Source)
>          at 
> org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown 
> Source)
>          at 
> org.apache.batik.dom.svg.SAXSVGDocumentFactory.createSVGDocument(Unknown 

> Source)
>          at org.apache.batik.bridge.DocumentLoader.loadDocument(Unknown 
> Source)
>          at org.apache.batik.bridge.URIResolver.getNode(Unknown Source)
>          at 
> org.apache.batik.bridge.BridgeContext.getReferencedNode(Unknown Source)
>          at 
> org.apache.batik.bridge.BridgeContext.getReferencedElement(Unknown 
Source)
>          at org.apache.batik.bridge.FontFace.getFontFamily(Unknown 
Source)
>          at org.apache.batik.bridge.FontFace.getFontFamily(Unknown 
Source)
>          at org.apache.batik.bridge.CSSFontFace.getFontFamily(Unknown 
> Source)
>          at 
> org.apache.batik.bridge.SVGFontUtilities.getFontFamily(Unknown Source)
>          at 
> org.apache.batik.bridge.SVGTextElementBridge.getFontFamilyList(Unknown 
> Source)
>          at 
> org.apache.batik.bridge.SVGTextElementBridge.getAttributeMap(Unknown 
Source)
>          at 
> 
org.apache.batik.bridge.SVGTextElementBridge.fillAttributedStringBuffer(Unknown 

> Source)
>          at 
> 
org.apache.batik.bridge.SVGTextElementBridge.buildAttributedString(Unknown 

> Source)
>          at 
> org.apache.batik.bridge.SVGTextElementBridge.computeLaidoutText(Unknown 
> Source)
>          at 
> org.apache.batik.bridge.SVGTextElementBridge.buildGraphicsNode(Unknown 
> Source)
>          at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown 

> Source)
>          at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown 
> Source)
>          at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown 

> Source)
>          at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown 
> Source)
>          at org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
>          at org.apache.batik.swing.svg.GVTTreeBuilder.run(Unknown 
Source)
> 
> --------------
> I really don't know which of the files is meant. 
> "http://www.carto.net/geofotos/index.svg" or the file 
> "http://www.carto.net/geofotos/geophotos_map.xml" or another file loaded 

> at the beginning?
> 
> What does it mean? A problem with encoding or the wrong UTF-8 header?
> 
> Thanks for any hint on the problem,
> Andreas
> 
> -- 
> ----------------------------------------------
> Andreas Neumann - Institute of Cartography
> Swiss Federal Institute of Technology (ETH)
> ETH Hoenggerberg
> CH-8093  Zurich, Switzerland
> Phone: ++41-1-633 3031, Fax: ++41-1-633 1153
> e-mail: neumann@karto.baug.ethz.ch
> www: http://www.carto.net/neumann/
> SVG.Open: http://www.svgopen.org/
> Carto.net: http://www.carto.net/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org