I'm reasonably certain the answer to this is "no," but it would save me enough trouble if the answer is "yes" that I figure it's worth a shot...
Does the Flash xml parser recognize xi:include?
Best I can tell, it does not.
baron ruhstoff 2008.04.15, 07:54PM — xi:include
JLM 2008.04.15, 11:01PM —
man that question requires way too much knowledge that might be beyond every day flash use. You want XML with some type of include I am sure you could code something up to handle includes how do they normally work?
baron ruhstoff 2008.04.16, 02:47PM —
Nah, it's not that difficult. All that's needed is a namespace declaration and an include statement:
<?xml version="1.0" encoding="UTF-8"?>
<someDoc xmlns:xi="http://www.w3.org/2001/XInclude">
<someNode>
<xi:include href="anotherDoc.xml"/>
</someNode>
</someDoc>
One thing to remember is that the included file can't be a complete xml doc (i.e. no doctype decl, etc.).
Hideaway 2008.04.16, 02:57PM —
This <xi:include /> shat is news to me... nice to know...
baron ruhstoff 2008.04.17, 01:17PM —
Originally posted by: scudsucker
I cant for the life of me see a use for this- can you outline a possible useage scenario?
The navigation scheme for your app is structured by an xml doc. Each view has a set of assets - images, videos, etc. - supplied by the associated node defining the view and loaded at runtime. Some assets are always grouped with others; other assets only appear infrequently.
Say you have fifty different views that must be defined. Of these fifty, forty share the same set of thirty assets. Defining the set in a single location rather than forty separate times makes an increasingly complex document much easier to maintain. Reduce, reuse, recycle.
Hideaway 2008.04.17, 01:17PM —
Sure... Instead of having one large XML file, you can break it up into a series of tens of thousands of files nested into arbitrary directories... And you can have thousands of combinations of the above...
Makes total sense...
baron ruhstoff 2008.04.17, 01:21PM —
Originally posted by: Hideaway
Sure... Instead of having one large XML file, you can break it up into a series of tens of thousands of files nested into arbitrary directories... And you can have thousands of combinations of the above...
Makes total sense...
OOP

// edit: Okay, so let's say you have one big XML doc in which the same asset is used one hundred times. Then let's say that for whatever reason, you need to change something about the asset - the path, the file, an attribute, whatever. Can you honestly say you would prefer making the same edit to a big-ass structurally complex doc one hundred times over a single edit to a four or five line doc?
mystic_juju 2008.04.17, 02:02PM —
you could probably write some fairly easy php code to do all the includes for you and create a single xml output. that way flash just reads the data from the single php file which has collated all the relevant files and echoed it out.
Hideaway 2008.04.17, 02:08PM —
Originally posted by: baron ruhstoff
OOP
I prefer rewriting all of my code from scratch multiple times in one project and repeat this for each project...
I also see no need for useless recursion and loops... Why use a "for" loop when you can copy and paste the same line thousands of times and change a few variables... Last I heard, you have virtually limitless lines available just waiting to be filled...
OOP is overrated... When you're paid hourly, that is...
baron ruhstoff 2008.04.17, 02:09PM —
Originally posted by: HideawayOriginally posted by: baron ruhstoff
OOP
I prefer rewriting all of my code from scratch multiple times in one project and repeat this for each project...
I also see no need for useless recursion and loops... Why use a "for" loop when you can copy and paste the same line thousands of times and change a few variables... Last I heard, you have virtually limitless lines available just waiting to be filled...
OOP is overrated... When you're paid hourly, that is...
JLM 2008.04.17, 10:38PM —
Subject seems to be getting off topic...
In regard to multiple XML files, for small projects it is just overkill but for heavy asset ie elearning CD's it is common practice to use multiple XML files where each 'page' or each section of each 'page' would have a subtitles xml file and a content xml file, not only does this allow multiple people to work on a project but it is easier to pass or fail sections of a project and may allow better load control of assets etc..
As for the includes as I said I doubt it, but if flash recognises 'xi:include' as a node name then I do not see why you can not get it to load in the href value as a auxillary file, and it should be trival to build a recursive version, the new stuff in As3 should be easy to extract an XMLlist and then get href from them.
As for paid by the hour... there are no rules that will keep you safe in one place, copy and paste is prefered as anything else confuses the gimps, and in another you will be shot, and only nth degree oop abstraction is acceptable, my guess is after reading or being told about xtreme programing theory somewhere the ideal solution is somewhere between.
baron ruhstoff
for me atleast a recursive method that extracts includes should be no more difficult bar testing and getting it to work exactly than any other xml data extraction that you implement, am I missing something? I do not see why flash needs to implement such parsing since it would just add 'checks' and play runtime overheads and is easy enough for the flash coder to implement.
If your really struggling and the xi:stuff works as a node let me know and I will try some code.
Cheers ;J
scudsucker 2008.04.18, 08:49AM —
Ok, makes sense, though, for most projects I use PHP/ASP/.NET to collate XML data from a DB, rather than using static XML files.
Doesn't everyone?
Though, I suppose, you don't have that option on CDs
Hideaway 2008.04.18, 01:11PM —
I was joking about the recursive schtuff... I see what you're talking about, but you shouldn't have to use an ix:include statement... You should be able to just use a simple node with an XML doc URL to load when needed...
