Hi Phil, "Phil Wright" <[EMAIL PROTECTED]> wrote on 11/22/2006 01:38:11 PM:
> I can add flowText elements to my displayed document and they show up as > desired. If I then output the document and then load it into my app or > Squiggle the flowText elements aren't visible. It looks like you aren't providing xml prefixes or changing the default namespace for the flowText elements. The DOM lets you provide the namespace explicitly but unless you associate a namespace prefix and use it, that namespace association may be lost when you serialize the document. > Here is a complete output file: > =========================================================== > <svg contentScriptType="text/ecmascript" width="500" > xmlns:xlink="http://www.w3.org/1999/xlink " zoomAndPan="magnify" > contentStyleType="text/css" height="600" > preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg " > version="1.2"> > <g style="overflow:hidden" id="content"> > <defs> > <pattern x="0" y="0" width="100%" > xmlns:xlink="http://www.w3.org/1999/xlink" > patternUnits="userSpaceOnUse" xlink:type="simple" > xlink:actuate="onLoad" height=".25in" id="hstripes" > preserveAspectRatio="xMidYMid meet" xlink:show="other"> > <rect fill="black" width="100%" fill-opacity=".2" height="2"/> > </pattern> > <pattern x="0" y="0" width=".25in" > xmlns:xlink="http://www.w3.org/1999/xlink " > patternUnits="userSpaceOnUse" xlink:type="simple" > xlink:actuate="onLoad" height="100%" id="vstripes" > preserveAspectRatio="xMidYMid meet" xlink:show="other"> > <rect fill="black" width="2" fill-opacity=".2" height="100%"/> > </pattern> > </defs> > <rect fill="url(#hstripes)" width="100%" height="100%" id="hstripes" > visibility="visible"/> > <rect fill="url(#vstripes)" width="100%" height="100%" id="vstripes" > visibility="hidden"/> > <g id="blocks"> > <flowText font-size="16pt" font-family="Dialog" xml:space="preserve" > font-style="normal" id="txtblock0" font-weight="normal"> > <flowRegion> > <rect width="210" x="75" height="141" y="75"/></flowRegion> > <flowDiv> > <flowPara>Some text</flowPara></flowDiv></flowText> > </g> > </g> > </svg> > =========================================================== > > I'm loading it with this code: > > String parser, uri; > SAXSVGDocumentFactory factory; > File f = fc.getSelectedFile(); > try { > svgCanvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC); > parser = XMLResourceDescriptor.getXMLParserClassName(); > factory = new SAXSVGDocumentFactory(parser); > svgCanvas.setURI(f.toURL().toString()); > uri = svgCanvas.getURI(); > document = factory.createSVGDocument(uri); > svgCanvas.setDocument(document); > } catch (IOException ex) { > ex.printStackTrace(); > } > > It is probably my lack of understanding of namespaces but what am I doing wrong? > > Thanks, > > Phil > > -- > Visit http://www.darkisle.com for photos of castles, cairns and other historic > sites in the British Isles. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
