On 26 mrt 2008, at 19:35, Marty Vance wrote:
> Also, language and locale do not necessarily
correlate.
Well, they do correlate, but are two different things.
Language is a
subset of locale.
> I have no
> objection to using xml:lang to switch languages, but
I'm pretty sure
> we'll have to implement our own locale switching.
Agreed. Locale switching is much more complex. I'm
suppressing it in
my head. It would be awesome already if we could seamlessly
switch
language only, in its broadest sense. I havent seen many
real requests
for in-page complete locale switching, nor do i have a good
understanding what it would be like to switch a complete
locale.
> What are the steps, as you see them? xar:set is
arguably the most
> versatile tag we have, but it is prone to exploitation.
Even if
> "assignable" has different meanings in XML
and PHP, do we still need
> to
> maintain a point in the process where data/expressions
"jump" this
> fence?
As some examples of initial steps i see:
- ironing out all the known inconsistencies, making sure we
dont
introduce new ones
- making the use of xar:var more consistent within the xml
framework
(this has already started)
- solving part of the expression problems, perhaps
temporarily,
allowing to set/create data-structures without going into
php mode
(the latter may just be rewriting some xar:set's into
GUI/API files,
dunno really)
- re-evaluating xar:var/xar:mlvar/xar:set after we have
changed MLS
concept.
In general, most of the work involved is good specs. I think
the code
as such is not that hard to write, relatively speaking.
> XPath is an interesting direction that make sense
conceptually. It is
> feature-rich, but I doubt it can completely replace PHP
for us.
I think it can, if only because it is possible to 'extend'
xpath with
functions, just like we have expanded the xslt vocabulary a
little bit
for the BL2 compiler. Theoretically if we 'map' many
functions from
PHP to the XPath domain (we should not do this however).
Given the
extendable functions and the logical expression power XPath
already
has, i dont think there are constructs in templates which
need more
expressive power than that.
> Getting data out of a tpldata nodeset seems
straighforward, but what
> about putting new data into it (ie, xar:set)?
The principle of encoding, delivering and setting data in
the template
scope doesn't really change, just the vehicle for it.
Now we encode data as a (nested) array tplData, with XPath
we will
encode it as a XML fragment in a certain defined format
(dtd).
Getting a variable now is using the PHP way of 'adressing'
an element
in this array, where the contents of the array can be atomic
(string,
number, bool, etc.) or structured (array or object). Given
the tpl
data as XML fragment, the 'adressing' to get to a node(set)
is XPath.
Elements can be atomic (textnodes) or structured
(nodesets).
Setting a variable is now injecting a new element in the
tplData array
and making sure it has the right address. One of the
problems we have
now is that it's nigh impossible to create structured
elements in a
way which is acceptable, meaning that we still play nice in
the PHP
and XML world. Setting a variable with tplData as XML
fragment is
inserting a node(set) into the runtime XML fragment. This
can be done
by an XSL operation joining the two nodesets, or a DOM
manipulation.
The vehicle however is important here. In the current
situation we
constantly have to take 2 worlds into account. PHP and XML
(or worse:
pseudo XML). By making sure that the canvas (template), the
tpldata
and the adressing are all XML (and preferably standard) we
make our
lifes easier, from a coding perspective.
Sound all nice to me, but we still have to do it
> Future cases involve our output stream being
manipulated by XPath
> after
> xar has delivered it, how do we allow these expressions
to pass
> through
> BL (the same issues we've had with <!-- --> and
are soon going to have
> with <![CDATA[ ]]>)?
Not sure what you mean here. The output stream manipulated
by XPath?
> Will XPath allow us to discard the $tpl:foo ugliness at
the page
> template level?
Not sure what you mean here either. $tpl:foo is ugly in page
templates
because of the notation or the fact that it is there at
all?
> Scope: will each template's data nodeset have its own
root, or will
> all
> data become part of a universal nodeset?
A template as such is 'scoped', that is, it is used within a
certain
context. The template as such only requires a 'minimum'
nodeset to be
present at that scope so it's data is available. The nodeset
may
contain more than that if needed by the context. I envision
a nodeset
to be single rooted for a certain code-path. This is
however more a
gut feeling than anything else.
> I for one will probably need to see a template (even a
theoretically
> functional mockup) that uses XPath to fully understand
how the
> expressions and functions would be used.
Yes, that is a good idea. I did such a mock up in the past.
I think i
have that somewhere still. When time permits, will look that
up and
post somewhere.
marcel
--
Marcel van der Boom -- http://hsdev.com/mvdb.vcf
a>
HS-Development BV -- http://www.hsdev.com
So! webapplicaties -- http://make-it-so.info
_______________________________________________
Xaraya_devel mailing list
Xaraya_devel xaraya.com
http:
//xaraya.com/mailman/listinfo/xaraya_devel
|