<libraries>
<library>name=Uptown;Contact number=555 2552
<section>name=History
<book>name=American
<book>name=English
<book>name=African
<section>name=Fiction
<book>name=Space Adventures 2099
</section>
<section>name=Manga
<book>name=Akira
<book>name=Tetsuo
//this library entry has extra fields
<library>name=Downtown;demolition date=2029/10/07;Contact=Bill Murray; Contact number = 555 1525
<section>name=Science
<book>name=Apollo 13
<section>name=newspapers; type=subsection
<newspaper>name=Times
//This node uses the normal syntax in stead of simplified syntax
<paper>date=2021/10/10
[headline]Cubs win the world series
[number of pages]86
[copies sold]25625
</paper>
<paper>date=2021/10/11
[headline]Oops, our mistake
[number of pages]45
[copies sold]89940
We would like to apologize for that misinformation
printed in yesterday's paper.
<newspaper>name=Daily
<paper>date=2021/10/10
[headline]How to never lose at gambling
[copies sold]199991
[barcode]1251125425
The process of never losing at gambling is really quite simple
Don't gamble !
library
uses exclusively simplified syntax while the second library
mixes normal and simplified syntaxlibrary
lists more information about itself. Not all matching nodes need have the same fieldslibrary
has a subsection of newspapers
paper
nodes have additional data entries no other node has
libraries
". The first child is library
and thus it will return all library
nodes.
Now that you have a library
node (in this case the first node has an ID of 1) you can call the Children() function again, this time with the library
's ID to return all of the library's immediate children. The first node it will find is section
and thus it will return all section nodes until it finds the next library
node. In this case it will return 2 section
nodes.
You could follow the same logic to find the newspapers if you knew in advance which nodes would follow which but since not all library section
s have a section called newspaper
here you have 2 options.
AllNodesOfType("paper")
to fetch all paper
nodes in the entire fileNodesWithField("type","subsection")
to find all nodes that has a field called "type" that has a value of "subsection". Alternatively, since the newspapers node is the only one to contain the field "type" you could omit the value while still receiving the same result<mydata>
[age] 18
[can_vote] true
[name] Stormchaser
[url]aHR0cHM6Ly9teWJhZHN0dWRpb3MuY29t
[novalue]
Field | Type | Returns... |
age | float | 18.0 |
age | int | 18 |
age | boolean | true *1 |
can_vote | boolean | true *1 |
can_vote | int | 0 *2 |
can_vote | string | true |
can_vote | Vector3(Unity) | Vector3.zero |
name | string | Stormchaser |
name | boolean | true *1 |
name | Rect(Unity) | Rect(0,0,0,0) |
url | string | aHR0cHM6Ly9teWJhZHN0dWRpb3MuY29t |
url | Rotator(UE) | (0,0,0) |
url | Vector(UE) | (0,0,0) |
url | boolean | true |
novalue | float | 0.0f |
novalue | boolean | false |
novalue | Quaternion(Unity) | Quaternion.identity |
novalue | string(Unity) | string.Empty |
© 2019 myBad Studios