Skip to content

Commit

Permalink
003
Browse files Browse the repository at this point in the history
  • Loading branch information
qtfkwk committed Jun 21, 2024
1 parent 4918dc0 commit c2118c1
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,21 @@ fn main() -> Result<()> {

docx = docx.add_paragraph(Paragraph::new().add_run(Run::new().add_text("Hello")));

docx = docx.add_style(
Style::new("Heading 1", StyleType::Character)
.name("Heading 1")
.next("Body Text")
.size(18 * 2)
.bold(),
);
docx = docx.add_paragraph(
Paragraph::new()
.add_run(Run::new().add_text("Heading 1"))
.style("Heading 1"),
);

docx.build()
.pack(std::fs::File::create("validator/002.docx")?)?;
.pack(std::fs::File::create("validator/003.docx")?)?;

Ok(())
}
Binary file added validator/003.docx
Binary file not shown.
66 changes: 66 additions & 0 deletions validator/003.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
[
{
"Id": "Sch_UnexpectedElementContentExpectingComplex",
"Description": "The element has unexpected child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:pStyle'.",
"Namespaces": {},
"XPath": "/w:document[1]/w:body[1]/w:p[2]/w:pPr[1]",
"PartUri": "/word/document.xml",
"ErrorType": "Schema"
},
{
"Id": "Sch_UnexpectedElementContentExpectingComplex",
"Description": "The element has unexpected child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:pPr'.",
"Namespaces": {},
"XPath": "/w:styles[1]/w:style[2]",
"PartUri": "/word/styles.xml",
"ErrorType": "Schema"
},
{
"Id": "Sch_InvalidElementContentExpectingComplex",
"Description": "The element has invalid child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:rPr'. List of possible elements expected: <http://schemas.openxmlformats.org/wordprocessingml/2006/main:keepNext>.",
"Namespaces": {},
"XPath": "/w:styles[1]/w:style[2]/w:pPr[1]",
"PartUri": "/word/styles.xml",
"ErrorType": "Schema"
},
{
"Id": "Sch_UnexpectedElementContentExpectingComplex",
"Description": "The element has unexpected child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:b'.",
"Namespaces": {},
"XPath": "/w:styles[1]/w:style[2]/w:rPr[1]",
"PartUri": "/word/styles.xml",
"ErrorType": "Schema"
},
{
"Id": "Sch_UnexpectedElementContentExpectingComplex",
"Description": "The element has unexpected child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:pPr'.",
"Namespaces": {},
"XPath": "/w:styles[1]/w:style[1]",
"PartUri": "/word/styles.xml",
"ErrorType": "Schema"
},
{
"Id": "Sch_InvalidElementContentExpectingComplex",
"Description": "The element has invalid child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:rPr'. List of possible elements expected: <http://schemas.openxmlformats.org/wordprocessingml/2006/main:keepNext>.",
"Namespaces": {},
"XPath": "/w:styles[1]/w:style[1]/w:pPr[1]",
"PartUri": "/word/styles.xml",
"ErrorType": "Schema"
},
{
"Id": "Sch_InvalidElementContentExpectingComplex",
"Description": "The element has invalid child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:rPr'. List of possible elements expected: <http://schemas.openxmlformats.org/wordprocessingml/2006/main:keepNext>.",
"Namespaces": {},
"XPath": "/w:styles[1]/w:docDefaults[1]/w:pPrDefault[1]/w:pPr[1]",
"PartUri": "/word/styles.xml",
"ErrorType": "Schema"
},
{
"Id": "Sch_UnexpectedElementContentExpectingComplex",
"Description": "The element has unexpected child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:zoom'.",
"Namespaces": {},
"XPath": "/w:settings[1]",
"PartUri": "/word/settings.xml",
"ErrorType": "Schema"
}
]

0 comments on commit c2118c1

Please sign in to comment.