1 /* |
1 /* |
2 * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. |
2 * reserved comment block |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT REMOVE OR ALTER! |
4 * |
|
5 * This code is free software; you can redistribute it and/or modify it |
|
6 * under the terms of the GNU General Public License version 2 only, as |
|
7 * published by the Free Software Foundation. Sun designates this |
|
8 * particular file as subject to the "Classpath" exception as provided |
|
9 * by Sun in the LICENSE file that accompanied this code. |
|
10 * |
|
11 * This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 * version 2 for more details (a copy is included in the LICENSE file that |
|
15 * accompanied this code). |
|
16 * |
|
17 * You should have received a copy of the GNU General Public License version |
|
18 * 2 along with this work; if not, write to the Free Software Foundation, |
|
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 * |
|
21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
|
22 * CA 95054 USA or visit www.sun.com if you need additional information or |
|
23 * have any questions. |
|
24 */ |
4 */ |
25 /* |
5 /* |
26 * $Id: DOMURIDereferencer.java,v 1.19 2005/09/23 20:09:34 mullan Exp $ |
6 * Copyright 2005 The Apache Software Foundation. |
|
7 * |
|
8 * Licensed under the Apache License, Version 2.0 (the "License"); |
|
9 * you may not use this file except in compliance with the License. |
|
10 * You may obtain a copy of the License at |
|
11 * |
|
12 * http://www.apache.org/licenses/LICENSE-2.0 |
|
13 * |
|
14 * Unless required by applicable law or agreed to in writing, software |
|
15 * distributed under the License is distributed on an "AS IS" BASIS, |
|
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
17 * See the License for the specific language governing permissions and |
|
18 * limitations under the License. |
|
19 * |
|
20 */ |
|
21 /* |
|
22 * Copyright 2005 Sun Microsystems, Inc. All rights reserved. |
|
23 */ |
|
24 /* |
|
25 * $Id: DOMURIDereferencer.java,v 1.2 2008/07/24 15:20:32 mullan Exp $ |
27 */ |
26 */ |
28 package org.jcp.xml.dsig.internal.dom; |
27 package org.jcp.xml.dsig.internal.dom; |
29 |
28 |
30 import org.w3c.dom.Attr; |
29 import org.w3c.dom.Attr; |
31 import org.w3c.dom.Element; |
30 import org.w3c.dom.Element; |
81 } |
80 } |
82 |
81 |
83 // this is a bit of a hack to check for registered |
82 // this is a bit of a hack to check for registered |
84 // IDRefs and manually register them with Apache's IdResolver |
83 // IDRefs and manually register them with Apache's IdResolver |
85 // map which includes builtin schema knowledge of DSig/Enc IDs |
84 // map which includes builtin schema knowledge of DSig/Enc IDs |
86 if (context instanceof XMLSignContext) { |
85 Node referencedElem = dcc.getElementById(id); |
87 Node referencedElem = dcc.getElementById(id); |
86 if (referencedElem != null) { |
88 if (referencedElem != null) { |
87 IdResolver.registerElementById((Element) referencedElem, id); |
89 IdResolver.registerElementById((Element) referencedElem, id); |
|
90 } |
|
91 } |
88 } |
92 } |
89 } |
93 |
90 |
94 try { |
91 try { |
95 String baseURI = context.getBaseURI(); |
92 String baseURI = context.getBaseURI(); |