This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 195125
Collapse All | Expand All

(-)a/schema2beans/src/org/netbeans/modules/schema2beans/DOMBinding.java (-1 / +15 lines)
Lines 861-866 Link Here
861
861
862
                    Node parent = prop.getParentNode();
862
                    Node parent = prop.getParentNode();
863
                    this.node = f.createElement(prop);
863
                    this.node = f.createElement(prop);
864
                    configureNS(node, parent);
864
865
865
                    if (DDLogFlags.debug) {
866
                    if (DDLogFlags.debug) {
866
                        TraceLogger.put(TraceLogger.DEBUG, TraceLogger.SVC_DD,
867
                        TraceLogger.put(TraceLogger.DEBUG, TraceLogger.SVC_DD,
Lines 902-907 Link Here
902
                            NodeFactory f = prop.getNodeFactory();
903
                            NodeFactory f = prop.getNodeFactory();
903
                            if (node == null) {
904
                            if (node == null) {
904
                                node = f.createElement(prop);
905
                                node = f.createElement(prop);
906
                                configureNS(node, parent);                              
905
                                Node sibling = prop.getFollowingSibling(this);
907
                                Node sibling = prop.getFollowingSibling(this);
906
                                parent.insertBefore(this.node, sibling);
908
                                parent.insertBefore(this.node, sibling);
907
                            }
909
                            }
Lines 943-949 Link Here
943
                    if (this.node == null) {
945
                    if (this.node == null) {
944
                        Node parent = prop.getParentNode();
946
                        Node parent = prop.getParentNode();
945
                        this.node = f.createElement(prop);
947
                        this.node = f.createElement(prop);
946
948
                        configureNS(node, parent);
949
                    
947
                        if (DDLogFlags.debug) {
950
                        if (DDLogFlags.debug) {
948
                            TraceLogger.put(TraceLogger.DEBUG,
951
                            TraceLogger.put(TraceLogger.DEBUG,
949
                                            TraceLogger.SVC_DD,
952
                                            TraceLogger.SVC_DD,
Lines 1002-1007 Link Here
1002
    boolean hasDomNode() {
1005
    boolean hasDomNode() {
1003
	return (this.node != null);
1006
	return (this.node != null);
1004
    }
1007
    }
1008
    
1009
    private static void configureNS(Node node, Node parent) {
1010
        Document doc = parent.getOwnerDocument();
1011
        if (parent.getNamespaceURI() != null && parent.getNamespaceURI().equals(node.getNamespaceURI())) {
1012
            node.setPrefix(parent.getPrefix());
1013
        } else if (parent.getNamespaceURI() != null
1014
                && node instanceof Element
1015
                && doc.getDocumentElement().getNamespaceURI() != null) {
1016
            ((Element) node).setAttribute("xmlns", doc.getDocumentElement().getNamespaceURI()); // NOI18N
1017
        }        
1018
    }
1005
}
1019
}
1006
1020
1007
1021
(-)a/schema2beans/src/org/netbeans/modules/schema2beans/GraphManager.java (-2 / +5 lines)
Lines 210-216 Link Here
210
	Node n;
210
	Node n;
211
	for (n = doc.getFirstChild(); n != null; n = n.getNextSibling()) {
211
	for (n = doc.getFirstChild(); n != null; n = n.getNextSibling()) {
212
	    if (n.getNodeType() == Node.ELEMENT_NODE
212
	    if (n.getNodeType() == Node.ELEMENT_NODE
213
	    && n.getNodeName().equals(name)) {
213
	    && (name.equals(n.getNodeName()) || name.equals(n.getLocalName()))) {
214
		break;
214
		break;
215
	    }
215
	    }
216
	}
216
	}
Lines 506-512 Link Here
506
        Map dupDtdNameIterators = new HashMap();	// Map<String, Iterator<BeanProp>>
506
        Map dupDtdNameIterators = new HashMap();	// Map<String, Iterator<BeanProp>>
507
        for (Node n = node.getFirstChild(); n != null; n = n.getNextSibling()) {
507
        for (Node n = node.getFirstChild(); n != null; n = n.getNextSibling()) {
508
            if (n.getNodeType() == Node.ELEMENT_NODE) {
508
            if (n.getNodeType() == Node.ELEMENT_NODE) {
509
                String eltName = n.getNodeName();
509
                String eltName = n.getLocalName();
510
                if (eltName == null) {
511
                    eltName = n.getNodeName();
512
                }
510
513
511
                //System.out.println("eltName="+eltName);
514
                //System.out.println("eltName="+eltName);
512
                BeanProp matchingProp = (BeanProp) dtdName2Prop.get(eltName);
515
                BeanProp matchingProp = (BeanProp) dtdName2Prop.get(eltName);
(-)a/schema2beans/src/org/netbeans/modules/schema2beans/NodeFactory.java (-1 / +5 lines)
Lines 61-67 Link Here
61
    }
61
    }
62
62
63
    Node createElement(BeanProp prop) {
63
    Node createElement(BeanProp prop) {
64
	return this.factory.createElement(prop.getDtdName());
64
        String ns = factory.getDocumentElement().getNamespaceURI();
65
        if (ns != null) {
66
            return this.factory.createElementNS(ns, prop.getDtdName());
67
        }
68
        return this.factory.createElement(prop.getDtdName());
65
    }
69
    }
66
70
67
    Node createText() {
71
    Node createText() {

Return to bug 195125