OLD | NEW |
1 /* | 1 /* |
2 * This file is part of the XSL implementation. | 2 * This file is part of the XSL implementation. |
3 * | 3 * |
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple, Inc. All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple, Inc. All rights reserved. |
5 * Copyright (C) 2005, 2006 Alexey Proskuryakov <ap@webkit.org> | 5 * Copyright (C) 2005, 2006 Alexey Proskuryakov <ap@webkit.org> |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 } | 300 } |
301 | 301 |
302 bool XSLTProcessor::transformToString(Node* sourceNode, String& mimeType, String
& resultString, String& resultEncoding) | 302 bool XSLTProcessor::transformToString(Node* sourceNode, String& mimeType, String
& resultString, String& resultEncoding) |
303 { | 303 { |
304 RefPtr<Document> ownerDocument = sourceNode->document(); | 304 RefPtr<Document> ownerDocument = sourceNode->document(); |
305 | 305 |
306 setXSLTLoadCallBack(docLoaderFunc, this, ownerDocument->cachedResourceLoader
()); | 306 setXSLTLoadCallBack(docLoaderFunc, this, ownerDocument->cachedResourceLoader
()); |
307 xsltStylesheetPtr sheet = xsltStylesheetPointer(m_stylesheet, m_stylesheetRo
otNode.get()); | 307 xsltStylesheetPtr sheet = xsltStylesheetPointer(m_stylesheet, m_stylesheetRo
otNode.get()); |
308 if (!sheet) { | 308 if (!sheet) { |
309 setXSLTLoadCallBack(0, 0, 0); | 309 setXSLTLoadCallBack(0, 0, 0); |
| 310 m_stylesheet = 0; |
310 return false; | 311 return false; |
311 } | 312 } |
312 m_stylesheet->clearDocuments(); | 313 m_stylesheet->clearDocuments(); |
313 | 314 |
314 xmlChar* origMethod = sheet->method; | 315 xmlChar* origMethod = sheet->method; |
315 if (!origMethod && mimeType == "text/html") | 316 if (!origMethod && mimeType == "text/html") |
316 sheet->method = (xmlChar*)"html"; | 317 sheet->method = (xmlChar*)"html"; |
317 | 318 |
318 bool success = false; | 319 bool success = false; |
319 bool shouldFreeSourceDoc = false; | 320 bool shouldFreeSourceDoc = false; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 setXSLTLoadCallBack(0, 0, 0); | 367 setXSLTLoadCallBack(0, 0, 0); |
367 xsltFreeStylesheet(sheet); | 368 xsltFreeStylesheet(sheet); |
368 m_stylesheet = 0; | 369 m_stylesheet = 0; |
369 | 370 |
370 return success; | 371 return success; |
371 } | 372 } |
372 | 373 |
373 } // namespace WebCore | 374 } // namespace WebCore |
374 | 375 |
375 #endif // ENABLE(XSLT) | 376 #endif // ENABLE(XSLT) |
OLD | NEW |