Hy, many thank for the help, It's running :-)))))))

but there are still two more question:
- With the namespace attribute I don't need to specify the attribute xmlns:fo anymore 
right?
  It's running without the setting (uncomment in code.)

  private Element createChildNS(Node node, Document doc, String elm) {
    Element element = doc.createElementNS("http://www.w3.org/1999/XSL/Format";, elm);
    node.appendChild(element);   
    return element;
  }

  protected Document createMyDocument() {
    DocumentBuilderFactory fac = DocumentBuilderFactory.newInstance();
    fac.setNamespaceAware(true);
    Document doc = null;
    try {
      doc = fac.newDocumentBuilder().newDocument();
    } catch(ParserConfigurationException e) {}
   
    Element root = createChildNS(doc, doc, "root");
    //root.setAttribute("xmlns:fo", "http://www.w3.org/1999/XSL/Format";);
         
    Element lms = createChildNS(root, doc, "layout-master-set");
    Element spm = createChildNS(lms, doc, "simple-page-master");
    spm.setAttribute("page-width","21cm");
...     
    return doc;    
  }


- Writing the fo-File to HD with the XML-Serializer I have got the following result, I 
cant find an information about namespaces why? 
Code for output
      org.apache.xalan.serialize.SerializerToXML sss= new 
org.apache.xalan.serialize.SerializerToXML(); 
      sss.setOutputStream(fileOutputStrem);
      sss.serialize(foDocument);
...

Fo-File
<?xml version="1.0" encoding="UTF-8"?>
<root><layout-master-set><simple-page-master margin-left="0.0cm" margin-top="0.1cm" 
master-name="page" page-height="29
...

Thanks 
Juergen Lippold


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to