34 CFX_XMLInstruction node
(L"acrobat"
);
35 EXPECT_EQ(0U, node.GetTargetData().size());
40 auto& data = node.GetTargetData();
41 ASSERT_EQ(2U, data.size());
42 EXPECT_EQ(L"firstString", data[0]);
43 EXPECT_EQ(L"secondString", data[1]);
86 static const char input[] =
87 "<?acrobat http://www.xfa.org/schema/xfa-template/3.3/ Display:1 ?>\n"
91 pdfium::MakeRetain<CFX_ReadOnlySpanStream>(pdfium::as_byte_span(input));
93 CFX_XMLParser parser(in_stream);
94 std::unique_ptr<CFX_XMLDocument> doc = parser.Parse();
95 ASSERT_TRUE(doc !=
nullptr);
97 CFX_XMLElement* root = doc->GetRoot();
98 ASSERT_TRUE(root->GetFirstChild() !=
nullptr);
101 CFX_XMLInstruction* node = ToXMLInstruction(root->GetFirstChild());
102 ASSERT_TRUE(node !=
nullptr);
105 auto& data = node->GetTargetData();
106 ASSERT_EQ(2U, data.size());
107 EXPECT_EQ(L"http://www.xfa.org/schema/xfa-template/3.3/", data[0]);
108 EXPECT_EQ(L"Display:1", data[1]);
110 auto out_stream = pdfium::MakeRetain<StringWriteStream>();
113 "<?acrobat http://www.xfa.org/schema/xfa-template/3.3/ Display:1 ?>\n",
114 out_stream->ToString());
118 static const char input[] =
120 "<?acrobat http://www.xfa.org/schema/xfa-template/3.3/ Display:1 ?>\n"
124 pdfium::MakeRetain<CFX_ReadOnlySpanStream>(pdfium::as_byte_span(input));
126 CFX_XMLParser parser(in_stream);
127 std::unique_ptr<CFX_XMLDocument> doc = parser.Parse();
128 ASSERT_TRUE(doc !=
nullptr);
130 CFX_XMLElement* root = doc->GetRoot();
131 ASSERT_TRUE(root->GetFirstChild() !=
nullptr);
134 CFX_XMLElement* node = ToXMLElement(root->GetFirstChild());
137 CFX_XMLInstruction* instruction =
nullptr;
138 for (
auto* elem = node->GetFirstChild(); elem && !instruction;
139 elem = elem->GetNextSibling()) {
140 instruction = ToXMLInstruction(elem);
142 ASSERT_TRUE(instruction !=
nullptr);
145 auto& data = instruction->GetTargetData();
146 ASSERT_EQ(2U, data.size());
147 EXPECT_EQ(L"http://www.xfa.org/schema/xfa-template/3.3/", data[0]);
148 EXPECT_EQ(L"Display:1", data[1]);
150 auto out_stream = pdfium::MakeRetain<StringWriteStream>();
154 "<?acrobat http://www.xfa.org/schema/xfa-template/3.3/ Display:1 ?>\n\n"
156 out_stream->ToString());