I was having some issues with
styles cascading from the root document through various
NetworkLinks.
When the root document loads and pulls in all the subsidiary NetworkLinks the styles defined in the root are applied correctly right up the tree to the final leaves.
However, once the
NetworkLinks began their autonomous refresh cycles
the styles from the root document were cancelled and all branches and leaves display using default styles

The only way I could prevent it was to embed the style library in
every linked document - which must cause a performance hit because the library is large, and is loaded (
redundantly) into several branches.
I tried using
Folder instead of
Document as the base tag in the child/grandChild documents, thinking that the style selector would then reference the root styles, but it didn't seem to make any difference.
There's no clear documentation on how to construction style selectors for this kind of scenario either. However there are examples of using a
fully qualified path selector of the form
http://domain.com/some/folders/to/file.kml#styleID.
I finally discovered that the way to do it is provide a
selector ID that is prefixed with the root document's file-name but no host or path information.
<styleUrl>root.kml#style1</styleUrl>Overview of my document structure:
Code:
<Document id="root">
<Style id="style1"></Style>
<StyleMap id="style2"></StyleMap>
<NetworkLink id="childLink"></NetworkLink>
</Document>
child then has:
Code:
<Document id="child">
<NetworkLink id="grandChild1Link"></NetworkLink>
<Folder id="cFolder">
<NetworkLink id="grandChild2Link"></NetworkLink>
<NetworkLink id="grandChild3Link"></NetworkLink>
</Folder>
</Document>
and
grandChild1 has:
Code:
<Document id="grandChild1">
<Folder id="gc1Folder1">
<Placemark id="gc1F1Child1">
<styleUrl>root.kml#style1</styleUrl>
</Placemark>
</Folder>
<Folder id="gc1Folder2">
<Placemark id="gc1F2Child1">
<styleUrl>root.kml#style2</styleUrl>
</Placemark>
</Folder>
<Folder id="gc1Folder3">
<Placemark id="gc1F3Child1">
<styleUrl>root.kml#style1</styleUrl>
</Placemark>
</Folder>
</Document>