OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "xfa/fxfa/parser/xfa_parser_imp.h" | 7 #include "xfa/fxfa/parser/xfa_parser_imp.h" |
8 | 8 |
9 #include "xfa/fde/xml/fde_xml_imp.h" | 9 #include "xfa/fde/xml/fde_xml_imp.h" |
10 #include "xfa/fgas/crt/fgas_codepage.h" | 10 #include "xfa/fgas/crt/fgas_codepage.h" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 wsNSAttribute = FX_WSTRC(L"xmlns"); | 205 wsNSAttribute = FX_WSTRC(L"xmlns"); |
206 bRet = TRUE; | 206 bRet = TRUE; |
207 } else { | 207 } else { |
208 wsNSAttribute = FX_WSTRC(L"xmlns:") + wsQualifier; | 208 wsNSAttribute = FX_WSTRC(L"xmlns:") + wsQualifier; |
209 } | 209 } |
210 for (; pNode != pFakeRoot; pNode = static_cast<CFDE_XMLElement*>( | 210 for (; pNode != pFakeRoot; pNode = static_cast<CFDE_XMLElement*>( |
211 pNode->GetNodeItem(CFDE_XMLNode::Parent))) { | 211 pNode->GetNodeItem(CFDE_XMLNode::Parent))) { |
212 if (pNode->GetType() != FDE_XMLNODE_Element) { | 212 if (pNode->GetType() != FDE_XMLNODE_Element) { |
213 continue; | 213 continue; |
214 } | 214 } |
215 if (pNode->HasAttribute(wsNSAttribute)) { | 215 if (pNode->HasAttribute(wsNSAttribute.c_str())) { |
216 pNode->GetString(wsNSAttribute, wsNamespaceURI); | 216 pNode->GetString(wsNSAttribute.c_str(), wsNamespaceURI); |
217 return TRUE; | 217 return TRUE; |
218 } | 218 } |
219 } | 219 } |
220 wsNamespaceURI.Empty(); | 220 wsNamespaceURI.Empty(); |
221 return bRet; | 221 return bRet; |
222 } | 222 } |
223 static inline void XFA_FDEExtension_GetElementTagNamespaceURI( | 223 static inline void XFA_FDEExtension_GetElementTagNamespaceURI( |
224 CFDE_XMLElement* pElement, | 224 CFDE_XMLElement* pElement, |
225 CFX_WideString& wsNamespaceURI) { | 225 CFX_WideString& wsNamespaceURI) { |
226 CFX_WideString wsNodeStr; | 226 CFX_WideString wsNodeStr; |
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1142 wsAttrQualifiedName); | 1142 wsAttrQualifiedName); |
1143 pXFAMetaData->SetCData(XFA_ATTRIBUTE_Value, wsAttrValue); | 1143 pXFAMetaData->SetCData(XFA_ATTRIBUTE_Value, wsAttrValue); |
1144 pXFAMetaData->SetEnum(XFA_ATTRIBUTE_Contains, | 1144 pXFAMetaData->SetEnum(XFA_ATTRIBUTE_Contains, |
1145 XFA_ATTRIBUTEENUM_MetaData); | 1145 XFA_ATTRIBUTEENUM_MetaData); |
1146 pXFAChild->InsertChild(pXFAMetaData); | 1146 pXFAChild->InsertChild(pXFAMetaData); |
1147 pXFAMetaData->SetXMLMappingNode(pXMLElement); | 1147 pXFAMetaData->SetXMLMappingNode(pXMLElement); |
1148 pXFAMetaData->SetFlag(XFA_NODEFLAG_Initialized, TRUE, FALSE); | 1148 pXFAMetaData->SetFlag(XFA_NODEFLAG_Initialized, TRUE, FALSE); |
1149 } | 1149 } |
1150 if (!bNeedValue) { | 1150 if (!bNeedValue) { |
1151 CFX_WideString wsNilName = FX_WSTRC(L"xsi:nil"); | 1151 CFX_WideString wsNilName = FX_WSTRC(L"xsi:nil"); |
1152 pXMLElement->RemoveAttribute(wsNilName); | 1152 pXMLElement->RemoveAttribute(wsNilName.c_str()); |
1153 } | 1153 } |
1154 } | 1154 } |
1155 pXFANode->InsertChild(pXFAChild); | 1155 pXFANode->InsertChild(pXFAChild); |
1156 if (eNodeType == XFA_ELEMENT_DataGroup) { | 1156 if (eNodeType == XFA_ELEMENT_DataGroup) { |
1157 ParseDataGroup(pXFAChild, pXMLElement, ePacketID); | 1157 ParseDataGroup(pXFAChild, pXMLElement, ePacketID); |
1158 } else { | 1158 } else { |
1159 if (bNeedValue) { | 1159 if (bNeedValue) { |
1160 ParseDataValue(pXFAChild, pXMLChild, XFA_XDPPACKET_Datasets); | 1160 ParseDataValue(pXFAChild, pXMLChild, XFA_XDPPACKET_Datasets); |
1161 } | 1161 } |
1162 } | 1162 } |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1557 } | 1557 } |
1558 if (pPause && iCount > 500 && pPause->NeedToPauseNow()) { | 1558 if (pPause && iCount > 500 && pPause->NeedToPauseNow()) { |
1559 break; | 1559 break; |
1560 } | 1560 } |
1561 } | 1561 } |
1562 return (m_syntaxParserResult == FDE_XmlSyntaxResult::Error || | 1562 return (m_syntaxParserResult == FDE_XmlSyntaxResult::Error || |
1563 m_NodeStack.GetSize() != 1) | 1563 m_NodeStack.GetSize() != 1) |
1564 ? -1 | 1564 ? -1 |
1565 : m_pParser->GetStatus(); | 1565 : m_pParser->GetStatus(); |
1566 } | 1566 } |
OLD | NEW |