Thomas DeWeese <[EMAIL PROTECTED]> writes: > Dudka Tetyana wrote: >> Hello! >> I have mystyle.css file. >> rect { >> fill: red; >> stroke: blue; >> stroke-width: 3 >> } >> I want to associate all style properties for SVG element using >> Cascading Style Sheets from the external >> CSS file. And I want to connect this css file from java >> application. And I don't know how to do this >> exactly from java file and then instead of writing >> rect.setAttributeNS(null, "style", "fill: red; stroke-width: 3"); >> I want just say what style to use. >> How can I do this? >> > The easiest way would be to add an 'svg:style' element > to the document and have that reference mystyle.css with it's > xlink:href attribute.
You could also add an XML processing instruction, like this: String data = "href=\"stylesheet.css\" type=\"text/css\""; ProcessingInstruction pi = doc.createProcessingInstruction("xml-stylesheet", data); doc.insertBefore(ssp, doc.getDocumentElement()); -- Måns Rullgård [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]