1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_xmlsecurity.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include "xsecparser.hxx"
32*cdf0e10cSrcweir #include <tools/debug.hxx>
33*cdf0e10cSrcweir #include "cppuhelper/exc_hlp.hxx"
34*cdf0e10cSrcweir 
35*cdf0e10cSrcweir #include <string.h>
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir namespace cssu = com::sun::star::uno;
38*cdf0e10cSrcweir namespace cssxs = com::sun::star::xml::sax;
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir #define RTL_ASCII_USTRINGPARAM( asciiStr ) asciiStr, strlen( asciiStr ), RTL_TEXTENCODING_ASCII_US
41*cdf0e10cSrcweir 
42*cdf0e10cSrcweir XSecParser::XSecParser(
43*cdf0e10cSrcweir 	XSecController* pXSecController,
44*cdf0e10cSrcweir 	const cssu::Reference< cssxs::XDocumentHandler >& xNextHandler )
45*cdf0e10cSrcweir 	: m_pXSecController(pXSecController),
46*cdf0e10cSrcweir 	  m_xNextHandler(xNextHandler),
47*cdf0e10cSrcweir 	  m_bReferenceUnresolved(false)
48*cdf0e10cSrcweir {
49*cdf0e10cSrcweir }
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir rtl::OUString XSecParser::getIdAttr(const cssu::Reference< cssxs::XAttributeList >& xAttribs )
52*cdf0e10cSrcweir {
53*cdf0e10cSrcweir 	rtl::OUString ouIdAttr = xAttribs->getValueByName(
54*cdf0e10cSrcweir 		rtl::OUString(RTL_ASCII_USTRINGPARAM("id")));
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir 	if (ouIdAttr == NULL)
57*cdf0e10cSrcweir 	{
58*cdf0e10cSrcweir 		ouIdAttr = xAttribs->getValueByName(
59*cdf0e10cSrcweir 			rtl::OUString(RTL_ASCII_USTRINGPARAM("Id")));
60*cdf0e10cSrcweir 	}
61*cdf0e10cSrcweir 
62*cdf0e10cSrcweir 	return ouIdAttr;
63*cdf0e10cSrcweir }
64*cdf0e10cSrcweir 
65*cdf0e10cSrcweir /*
66*cdf0e10cSrcweir  * XDocumentHandler
67*cdf0e10cSrcweir  */
68*cdf0e10cSrcweir void SAL_CALL XSecParser::startDocument(  )
69*cdf0e10cSrcweir 	throw (cssxs::SAXException, cssu::RuntimeException)
70*cdf0e10cSrcweir {
71*cdf0e10cSrcweir 	m_bInX509IssuerName = false;
72*cdf0e10cSrcweir 	m_bInX509SerialNumber = false;
73*cdf0e10cSrcweir 	m_bInX509Certificate = false;
74*cdf0e10cSrcweir 	m_bInSignatureValue = false;
75*cdf0e10cSrcweir 	m_bInDigestValue = false;
76*cdf0e10cSrcweir 	m_bInDate = false;
77*cdf0e10cSrcweir 	//m_bInTime = false;
78*cdf0e10cSrcweir 
79*cdf0e10cSrcweir 	if (m_xNextHandler.is())
80*cdf0e10cSrcweir 	{
81*cdf0e10cSrcweir 		m_xNextHandler->startDocument();
82*cdf0e10cSrcweir 	}
83*cdf0e10cSrcweir }
84*cdf0e10cSrcweir 
85*cdf0e10cSrcweir void SAL_CALL XSecParser::endDocument(  )
86*cdf0e10cSrcweir 	throw (cssxs::SAXException, cssu::RuntimeException)
87*cdf0e10cSrcweir {
88*cdf0e10cSrcweir 	if (m_xNextHandler.is())
89*cdf0e10cSrcweir 	{
90*cdf0e10cSrcweir 		m_xNextHandler->endDocument();
91*cdf0e10cSrcweir 	}
92*cdf0e10cSrcweir }
93*cdf0e10cSrcweir 
94*cdf0e10cSrcweir void SAL_CALL XSecParser::startElement(
95*cdf0e10cSrcweir 	const rtl::OUString& aName,
96*cdf0e10cSrcweir 	const cssu::Reference< cssxs::XAttributeList >& xAttribs )
97*cdf0e10cSrcweir 	throw (cssxs::SAXException, cssu::RuntimeException)
98*cdf0e10cSrcweir {
99*cdf0e10cSrcweir 	try
100*cdf0e10cSrcweir 	{
101*cdf0e10cSrcweir 		rtl::OUString ouIdAttr = getIdAttr(xAttribs);
102*cdf0e10cSrcweir 		if (ouIdAttr != NULL)
103*cdf0e10cSrcweir 		{
104*cdf0e10cSrcweir 			m_pXSecController->collectToVerify( ouIdAttr );
105*cdf0e10cSrcweir 		}
106*cdf0e10cSrcweir 
107*cdf0e10cSrcweir 		if ( aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_SIGNATURE)) )
108*cdf0e10cSrcweir 		{
109*cdf0e10cSrcweir 			m_pXSecController->addSignature();
110*cdf0e10cSrcweir 			if (ouIdAttr != NULL)
111*cdf0e10cSrcweir 			{
112*cdf0e10cSrcweir 				m_pXSecController->setId( ouIdAttr );
113*cdf0e10cSrcweir 			}
114*cdf0e10cSrcweir 		}
115*cdf0e10cSrcweir 		else if ( aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_REFERENCE)) )
116*cdf0e10cSrcweir 		{
117*cdf0e10cSrcweir 			rtl::OUString ouUri = xAttribs->getValueByName(rtl::OUString(RTL_ASCII_USTRINGPARAM(ATTR_URI)));
118*cdf0e10cSrcweir 			DBG_ASSERT( ouUri != NULL, "URI == NULL" );
119*cdf0e10cSrcweir 
120*cdf0e10cSrcweir 			if (0 == ouUri.compareTo(rtl::OUString(RTL_ASCII_USTRINGPARAM(CHAR_FRAGMENT)),1))
121*cdf0e10cSrcweir 			{
122*cdf0e10cSrcweir 				/*
123*cdf0e10cSrcweir 				* remove the first character '#' from the attribute value
124*cdf0e10cSrcweir 				*/
125*cdf0e10cSrcweir 				m_pXSecController->addReference( ouUri.copy(1) );
126*cdf0e10cSrcweir 			}
127*cdf0e10cSrcweir 			else
128*cdf0e10cSrcweir 			{
129*cdf0e10cSrcweir 				/*
130*cdf0e10cSrcweir 				* remember the uri
131*cdf0e10cSrcweir 				*/
132*cdf0e10cSrcweir 				m_currentReferenceURI = ouUri;
133*cdf0e10cSrcweir 				m_bReferenceUnresolved = true;
134*cdf0e10cSrcweir 			}
135*cdf0e10cSrcweir 		}
136*cdf0e10cSrcweir 			else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_TRANSFORM)))
137*cdf0e10cSrcweir 			{
138*cdf0e10cSrcweir 			if ( m_bReferenceUnresolved )
139*cdf0e10cSrcweir 			{
140*cdf0e10cSrcweir 				rtl::OUString ouAlgorithm = xAttribs->getValueByName(rtl::OUString(RTL_ASCII_USTRINGPARAM(ATTR_ALGORITHM)));
141*cdf0e10cSrcweir 
142*cdf0e10cSrcweir 				if (ouAlgorithm != NULL && ouAlgorithm == rtl::OUString(RTL_ASCII_USTRINGPARAM(ALGO_C14N)))
143*cdf0e10cSrcweir 				/*
144*cdf0e10cSrcweir 				* a xml stream
145*cdf0e10cSrcweir 				*/
146*cdf0e10cSrcweir 				{
147*cdf0e10cSrcweir 					m_pXSecController->addStreamReference( m_currentReferenceURI, sal_False);
148*cdf0e10cSrcweir 					m_bReferenceUnresolved = false;
149*cdf0e10cSrcweir 				}
150*cdf0e10cSrcweir 			}
151*cdf0e10cSrcweir 			}
152*cdf0e10cSrcweir 			else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_X509ISSUERNAME)))
153*cdf0e10cSrcweir 			{
154*cdf0e10cSrcweir 			m_ouX509IssuerName = rtl::OUString::createFromAscii("");
155*cdf0e10cSrcweir 			m_bInX509IssuerName = true;
156*cdf0e10cSrcweir 			}
157*cdf0e10cSrcweir 			else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_X509SERIALNUMBER)))
158*cdf0e10cSrcweir 			{
159*cdf0e10cSrcweir 			m_ouX509SerialNumber = rtl::OUString::createFromAscii("");
160*cdf0e10cSrcweir 			m_bInX509SerialNumber = true;
161*cdf0e10cSrcweir 			}
162*cdf0e10cSrcweir 			else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_X509CERTIFICATE)))
163*cdf0e10cSrcweir 			{
164*cdf0e10cSrcweir 			m_ouX509Certificate = rtl::OUString::createFromAscii("");
165*cdf0e10cSrcweir 			m_bInX509Certificate = true;
166*cdf0e10cSrcweir 			}
167*cdf0e10cSrcweir 			else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_SIGNATUREVALUE)))
168*cdf0e10cSrcweir 			{
169*cdf0e10cSrcweir 			m_ouSignatureValue = rtl::OUString::createFromAscii("");
170*cdf0e10cSrcweir         		m_bInSignatureValue = true;
171*cdf0e10cSrcweir 			}
172*cdf0e10cSrcweir 			else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_DIGESTVALUE)))
173*cdf0e10cSrcweir 			{
174*cdf0e10cSrcweir 			m_ouDigestValue = rtl::OUString::createFromAscii("");
175*cdf0e10cSrcweir         		m_bInDigestValue = true;
176*cdf0e10cSrcweir 			}
177*cdf0e10cSrcweir 			else if ( aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_SIGNATUREPROPERTY)) )
178*cdf0e10cSrcweir 		{
179*cdf0e10cSrcweir 			if (ouIdAttr != NULL)
180*cdf0e10cSrcweir 			{
181*cdf0e10cSrcweir 				m_pXSecController->setPropertyId( ouIdAttr );
182*cdf0e10cSrcweir 			}
183*cdf0e10cSrcweir 		}
184*cdf0e10cSrcweir 			else if (aName == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(NSTAG_DC))
185*cdf0e10cSrcweir         				+rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(":"))
186*cdf0e10cSrcweir         				+rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(TAG_DATE)))
187*cdf0e10cSrcweir 			{
188*cdf0e10cSrcweir 			m_ouDate = rtl::OUString::createFromAscii("");
189*cdf0e10cSrcweir         		m_bInDate = true;
190*cdf0e10cSrcweir 			}
191*cdf0e10cSrcweir 			/*
192*cdf0e10cSrcweir 			else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_TIME)))
193*cdf0e10cSrcweir 			{
194*cdf0e10cSrcweir 			m_ouTime = rtl::OUString::createFromAscii("");
195*cdf0e10cSrcweir         		m_bInTime = true;
196*cdf0e10cSrcweir 			}
197*cdf0e10cSrcweir 			*/
198*cdf0e10cSrcweir 
199*cdf0e10cSrcweir 		if (m_xNextHandler.is())
200*cdf0e10cSrcweir 		{
201*cdf0e10cSrcweir 			m_xNextHandler->startElement(aName, xAttribs);
202*cdf0e10cSrcweir 		}
203*cdf0e10cSrcweir 	}
204*cdf0e10cSrcweir 	catch (cssu::Exception& )
205*cdf0e10cSrcweir 	{//getCaughtException MUST be the first line in the catch block
206*cdf0e10cSrcweir         cssu::Any exc =  cppu::getCaughtException();
207*cdf0e10cSrcweir         throw cssxs::SAXException(
208*cdf0e10cSrcweir 			rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
209*cdf0e10cSrcweir                               "xmlsecurity: Exception in XSecParser::startElement")),
210*cdf0e10cSrcweir             0, exc);
211*cdf0e10cSrcweir 	}
212*cdf0e10cSrcweir 	catch (...)
213*cdf0e10cSrcweir 	{
214*cdf0e10cSrcweir 		throw cssxs::SAXException(
215*cdf0e10cSrcweir 			rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("xmlsecurity: unexpected exception in XSecParser::startElement")), 0,
216*cdf0e10cSrcweir 			cssu::Any());
217*cdf0e10cSrcweir 	}
218*cdf0e10cSrcweir }
219*cdf0e10cSrcweir 
220*cdf0e10cSrcweir void SAL_CALL XSecParser::endElement( const rtl::OUString& aName )
221*cdf0e10cSrcweir 	throw (cssxs::SAXException, cssu::RuntimeException)
222*cdf0e10cSrcweir {
223*cdf0e10cSrcweir 	try
224*cdf0e10cSrcweir 	{
225*cdf0e10cSrcweir         if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_DIGESTVALUE)))
226*cdf0e10cSrcweir 			{
227*cdf0e10cSrcweir         		m_bInDigestValue = false;
228*cdf0e10cSrcweir 			}
229*cdf0e10cSrcweir 		else if ( aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_REFERENCE)) )
230*cdf0e10cSrcweir 		{
231*cdf0e10cSrcweir 			if ( m_bReferenceUnresolved )
232*cdf0e10cSrcweir 			/*
233*cdf0e10cSrcweir 			* it must be a octet stream
234*cdf0e10cSrcweir 			*/
235*cdf0e10cSrcweir 			{
236*cdf0e10cSrcweir 				m_pXSecController->addStreamReference( m_currentReferenceURI, sal_True);
237*cdf0e10cSrcweir 				m_bReferenceUnresolved = false;
238*cdf0e10cSrcweir 			}
239*cdf0e10cSrcweir 
240*cdf0e10cSrcweir 			m_pXSecController->setDigestValue( m_ouDigestValue );
241*cdf0e10cSrcweir 		}
242*cdf0e10cSrcweir 		else if ( aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_SIGNEDINFO)) )
243*cdf0e10cSrcweir 		{
244*cdf0e10cSrcweir 			m_pXSecController->setReferenceCount();
245*cdf0e10cSrcweir 		}
246*cdf0e10cSrcweir 		else if ( aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_SIGNATUREVALUE)) )
247*cdf0e10cSrcweir 		{
248*cdf0e10cSrcweir 			m_pXSecController->setSignatureValue( m_ouSignatureValue );
249*cdf0e10cSrcweir         		m_bInSignatureValue = false;
250*cdf0e10cSrcweir 		}
251*cdf0e10cSrcweir 			else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_X509ISSUERNAME)))
252*cdf0e10cSrcweir 			{
253*cdf0e10cSrcweir 			m_pXSecController->setX509IssuerName( m_ouX509IssuerName );
254*cdf0e10cSrcweir 			m_bInX509IssuerName = false;
255*cdf0e10cSrcweir 			}
256*cdf0e10cSrcweir 			else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_X509SERIALNUMBER)))
257*cdf0e10cSrcweir 			{
258*cdf0e10cSrcweir 			m_pXSecController->setX509SerialNumber( m_ouX509SerialNumber );
259*cdf0e10cSrcweir 			m_bInX509SerialNumber = false;
260*cdf0e10cSrcweir 			}
261*cdf0e10cSrcweir 			else if (aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_X509CERTIFICATE)))
262*cdf0e10cSrcweir 			{
263*cdf0e10cSrcweir 			m_pXSecController->setX509Certificate( m_ouX509Certificate );
264*cdf0e10cSrcweir 			m_bInX509Certificate = false;
265*cdf0e10cSrcweir 			}
266*cdf0e10cSrcweir 			else if (aName == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(NSTAG_DC))
267*cdf0e10cSrcweir         				+rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(":"))
268*cdf0e10cSrcweir         				+rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(TAG_DATE)))
269*cdf0e10cSrcweir 		{
270*cdf0e10cSrcweir 			m_pXSecController->setDate( m_ouDate );
271*cdf0e10cSrcweir         		m_bInDate = false;
272*cdf0e10cSrcweir 		}
273*cdf0e10cSrcweir 		/*
274*cdf0e10cSrcweir 		else if ( aName == rtl::OUString(RTL_ASCII_USTRINGPARAM(TAG_TIME)) )
275*cdf0e10cSrcweir 		{
276*cdf0e10cSrcweir 			m_pXSecController->setTime( m_ouTime );
277*cdf0e10cSrcweir         		m_bInTime = false;
278*cdf0e10cSrcweir 		}
279*cdf0e10cSrcweir 		*/
280*cdf0e10cSrcweir 
281*cdf0e10cSrcweir 		if (m_xNextHandler.is())
282*cdf0e10cSrcweir 		{
283*cdf0e10cSrcweir 			m_xNextHandler->endElement(aName);
284*cdf0e10cSrcweir 		}
285*cdf0e10cSrcweir 	}
286*cdf0e10cSrcweir 	catch (cssu::Exception& )
287*cdf0e10cSrcweir 	{//getCaughtException MUST be the first line in the catch block
288*cdf0e10cSrcweir         cssu::Any exc =  cppu::getCaughtException();
289*cdf0e10cSrcweir         throw cssxs::SAXException(
290*cdf0e10cSrcweir 			rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
291*cdf0e10cSrcweir                               "xmlsecurity: Exception in XSecParser::endElement")),
292*cdf0e10cSrcweir             0, exc);
293*cdf0e10cSrcweir 	}
294*cdf0e10cSrcweir 	catch (...)
295*cdf0e10cSrcweir 	{
296*cdf0e10cSrcweir 		throw cssxs::SAXException(
297*cdf0e10cSrcweir 			rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("xmlsecurity: unexpected exception in XSecParser::endElement")), 0,
298*cdf0e10cSrcweir 			cssu::Any());
299*cdf0e10cSrcweir 	}
300*cdf0e10cSrcweir }
301*cdf0e10cSrcweir 
302*cdf0e10cSrcweir void SAL_CALL XSecParser::characters( const rtl::OUString& aChars )
303*cdf0e10cSrcweir 	throw (cssxs::SAXException, cssu::RuntimeException)
304*cdf0e10cSrcweir {
305*cdf0e10cSrcweir 	if (m_bInX509IssuerName)
306*cdf0e10cSrcweir 	{
307*cdf0e10cSrcweir 		m_ouX509IssuerName += aChars;
308*cdf0e10cSrcweir 	}
309*cdf0e10cSrcweir 	else if (m_bInX509SerialNumber)
310*cdf0e10cSrcweir 	{
311*cdf0e10cSrcweir 		m_ouX509SerialNumber += aChars;
312*cdf0e10cSrcweir 	}
313*cdf0e10cSrcweir 	else if (m_bInX509Certificate)
314*cdf0e10cSrcweir 	{
315*cdf0e10cSrcweir 		m_ouX509Certificate += aChars;
316*cdf0e10cSrcweir 	}
317*cdf0e10cSrcweir 	else if (m_bInSignatureValue)
318*cdf0e10cSrcweir 	{
319*cdf0e10cSrcweir 		m_ouSignatureValue += aChars;
320*cdf0e10cSrcweir 	}
321*cdf0e10cSrcweir 	else if (m_bInDigestValue)
322*cdf0e10cSrcweir 	{
323*cdf0e10cSrcweir 		m_ouDigestValue += aChars;
324*cdf0e10cSrcweir 	}
325*cdf0e10cSrcweir 	else if (m_bInDate)
326*cdf0e10cSrcweir 	{
327*cdf0e10cSrcweir 		m_ouDate += aChars;
328*cdf0e10cSrcweir 	}
329*cdf0e10cSrcweir 	/*
330*cdf0e10cSrcweir 	else if (m_bInTime)
331*cdf0e10cSrcweir 	{
332*cdf0e10cSrcweir 		m_ouTime += aChars;
333*cdf0e10cSrcweir 	}
334*cdf0e10cSrcweir 	*/
335*cdf0e10cSrcweir 
336*cdf0e10cSrcweir 	if (m_xNextHandler.is())
337*cdf0e10cSrcweir 	{
338*cdf0e10cSrcweir 		m_xNextHandler->characters(aChars);
339*cdf0e10cSrcweir         }
340*cdf0e10cSrcweir }
341*cdf0e10cSrcweir 
342*cdf0e10cSrcweir void SAL_CALL XSecParser::ignorableWhitespace( const rtl::OUString& aWhitespaces )
343*cdf0e10cSrcweir 	throw (cssxs::SAXException, cssu::RuntimeException)
344*cdf0e10cSrcweir {
345*cdf0e10cSrcweir 	if (m_xNextHandler.is())
346*cdf0e10cSrcweir 	{
347*cdf0e10cSrcweir 		m_xNextHandler->ignorableWhitespace( aWhitespaces );
348*cdf0e10cSrcweir         }
349*cdf0e10cSrcweir }
350*cdf0e10cSrcweir 
351*cdf0e10cSrcweir void SAL_CALL XSecParser::processingInstruction( const rtl::OUString& aTarget, const rtl::OUString& aData )
352*cdf0e10cSrcweir 	throw (cssxs::SAXException, cssu::RuntimeException)
353*cdf0e10cSrcweir {
354*cdf0e10cSrcweir 	if (m_xNextHandler.is())
355*cdf0e10cSrcweir 	{
356*cdf0e10cSrcweir 		m_xNextHandler->processingInstruction(aTarget, aData);
357*cdf0e10cSrcweir         }
358*cdf0e10cSrcweir }
359*cdf0e10cSrcweir 
360*cdf0e10cSrcweir void SAL_CALL XSecParser::setDocumentLocator( const cssu::Reference< cssxs::XLocator >& xLocator )
361*cdf0e10cSrcweir 	throw (cssxs::SAXException, cssu::RuntimeException)
362*cdf0e10cSrcweir {
363*cdf0e10cSrcweir 	if (m_xNextHandler.is())
364*cdf0e10cSrcweir 	{
365*cdf0e10cSrcweir 		m_xNextHandler->setDocumentLocator( xLocator );
366*cdf0e10cSrcweir         }
367*cdf0e10cSrcweir }
368*cdf0e10cSrcweir 
369*cdf0e10cSrcweir /*
370*cdf0e10cSrcweir  * XInitialization
371*cdf0e10cSrcweir  */
372*cdf0e10cSrcweir void SAL_CALL XSecParser::initialize(
373*cdf0e10cSrcweir 	const cssu::Sequence< cssu::Any >& aArguments )
374*cdf0e10cSrcweir 	throw(cssu::Exception, cssu::RuntimeException)
375*cdf0e10cSrcweir {
376*cdf0e10cSrcweir 	aArguments[0] >>= m_xNextHandler;
377*cdf0e10cSrcweir }
378