Newer
Older
# BI-XML Semestral project winter 2018/2019
Jakub Jun ( junjakub@fit.cvut.cz )
## Requirements
- [make](https://www.gnu.org/software/make/)
- [saxon](http://saxon.sourceforge.net/)
- [fop](https://xmlgraphics.apache.org/fop/)
- [jing](https://relaxng.org/jclark/jing.html)
- browser
## Configuration
Edit [Makefile](Makefile) and fill in paths of the binaries of the required tools mentioned above.
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
- `make help` shows supported commands.
- `make merge` merges countries into one file
- `make dtd` validates against dtd schema
- `make rng` validates against rng schema
- `make html` generates html output
- `make pdf` generates pdf output
- `make present` opens html and pdf output in specified browser
- `make clean` to remove contents of `build/` directory
## File structure
```
├── build # contains output of make commands
│ ├── count_merged.xml # merged countries into 1 xml file
│ ├── countries.pdf # generated pdf file
│ └── html # contains html generated output
│ ├── index.html
│ ├── Jamaica.html
│ ├── Japan.html
│ ├── Jersey.html
│ └── Jordan.html
├── docs # contains project specification
│ ├── BI-XML-PROJEKT-INSTRUKCE.txt
│ ├── BI-XML-PROJEKT-PREZENTACE
│ └── zadani_junjakub.xml
├── Makefile # makes everything work!
├── README.md # this file
└── src # contains source files
├── countries # contains source xml for each country
│ ├── Jamaica.gif # flag
│ ├── jamaica.xml
│ ├── Japan.gif
│ ├── japan.xml
│ ├── Jersey.gif
│ ├── jersey.xml
│ ├── Jordan.gif
│ └── jordan.xml
├── merge.xml # merges countries into one file
├── transform # contains transformation stylesheets
│ ├── html_countries.xsl
│ ├── html_index.xsl
│ └── pdf.xsl
└── validate # contains validation schemas
├── schema.dtd
└── schema.rnc
```
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
## RNC Validation examples
### Regular expression
```
...
element Energy {
attribute name { xsd:NCName },
element Electrification {
attribute name { xsd:NCName },
xsd:token { pattern = "[0-9]+.?[0-9]*%" } # REGULARNI VYRAZ
},
element Electricity-production {
attribute name { text },
text
}
}
...
```
### nonNegativeInteger
```
element Transportation {
attribute name { xsd:NCName },
element Airports {
attribute name { xsd:NCName },
xsd:nonNegativeInteger
},
element Heliports {
attribute name { xsd:NCName },
xsd:nonNegativeInteger
}?
}
```
### String length
```
element Introduction {
attribute name { xsd:NCName },
element Background {
attribute name { xsd:NCName },
xsd:string { minLength="500" maxLength="2000" } # OMEZENI DELKY, CHCEME ASPON 500 U KAZDEHO
}
}
```
- https://www.cia.gov/library/publications/the-world-factbook/
- http://zvon.org/
- https://fit.cvut.cz/
- https://stackoverflow.com/
- https://gitlab.fit.cvut.cz/junjakub/bi-xml-semestral-project
- https://getbootstrap.com/docs/4.0/components
- https://www.w3schools.com/xml/xpath_intro.asp
- https://xmlgraphics.apache.org/fop/quickstartguide.html
- https://www.kosek.cz/xml/schema/rng.html