[coldspring-users] constructor-arg dtd inconstancies

4 views
Skip to first unread message

Brian Pickens

unread,
Apr 19, 2010, 10:41:26 AM4/19/10
to ColdSpring-Users
According to the coldspring dtd, it is possible to use "value" and
"ref" as attributes, instead of using them as children entities, as
short-cuts. But when I tried this coldspring threw a custom error. I
looked at the code, and it looks like it expects children entities.
Also, the dtd doesn't specify that 'name' is a valid attribute for
'constructor-arg', so XmlBuddy shows this as an error even though its
not. Could the dtd be updated to reflect the requirements in the code?

This is the parsePropertyDefinition() function inside the BeanProperty
class.

<!--- not (StructKeyExists(propertyDef.XmlAttributes,'name') and ---
>
<cfif not (StructKeyExists(propertyDef,'XmlChildren')
and ArrayLen(arguments.propertyDef.XmlChildren))>
<cfthrow type="coldspring.MalformedPropertyException" message="Xml
properties must contain a 'name' and a child element!">
</cfif>

Here are the dtd entries I'm referring to, and 'value' isn't among
them:
<!--
A short-cut alternative to a child element "ref bean=".
-->
<!ATTLIST constructor-arg ref CDATA #IMPLIED>

<!--
A short-cut alternative to a child element "value".
-->
<!ATTLIST constructor-arg value CDATA #IMPLIED>

--
You received this message because you are subscribed to the Google Groups "ColdSpring-Users" group.
To post to this group, send email to coldspri...@googlegroups.com.
To unsubscribe from this group, send email to coldspring-use...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/coldspring-users?hl=en.

Barney Boisvert

unread,
Apr 19, 2010, 11:54:00 AM4/19/10
to coldspri...@googlegroups.com
The "ColdSpring DTD" you reference is actually the Spring DTD.
ColdSpring doesn't have one of it's own. In particular, you must
supply "name" to "constructor-arg" (which the Spring DTD forbids), and
you cannot use shortcut attributes instead of child tags (the problem
you describe).

There are various other differences, but those are the two main ones.
I don't know if Mark is planning to supply a ColdSpring-specific
DTD/XSD with the new rev, but he's traveling to / training at
CFObjective at the moment, so I don't know if he'll be reading this.

The short answer, though, is that the Spring DTD is useful but not
"official". The only official spec for ColdSpring's functionality
that I know of is the code itself. It'd be pretty trivial to make
your own DTD if you wanted on that was more precise.

cheers,
barneyb
--
Barney Boisvert
bboi...@gmail.com
http://www.barneyb.com/

Brian Kotek

unread,
Apr 19, 2010, 11:54:40 AM4/19/10
to coldspri...@googlegroups.com
ColdSpring doesn't actually have a DTD. For most purposes, it is useful to use the official Spring DTD, but there are definitely things in the Spring DTD that ColdSpring doesn't support, such as the value and ref attributes. Also, the one place where CS differs from Spring is the "name" attribute for constructor arguments. This was an unfortunately requirement because prior to CF8, CF did not support positional arguments, only named arguments. Hopefully that helps clarify what you're seeing.

Thanks,

Brian

Brian Pickens

unread,
Apr 19, 2010, 2:40:52 PM4/19/10
to ColdSpring-Users
Oh I didn't realize that the dtd actually came from spring rather than
coldspring. Thanks for that clarification.
> > coldspring-use...@googlegroups.com<coldspring-users%2Bunsubscrib e...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/coldspring-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "ColdSpring-Users" group.
> To post to this group, send email to coldspri...@googlegroups.com.
> To unsubscribe from this group, send email to coldspring-use...@googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/coldspring-users?hl=en.
Reply all
Reply to author
Forward
0 new messages