• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Tags inside tags [was: Re: WebObjects 5.4 is out.]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tags inside tags [was: Re: WebObjects 5.4 is out.]


  • Subject: Re: Tags inside tags [was: Re: WebObjects 5.4 is out.]
  • From: Paul Hoadley <email@hidden>
  • Date: Sun, 4 Nov 2007 14:51:50 +1030

On 03/11/2007, at 7:33 PM, Paul Hoadley wrote:

On 27/10/2007, at 5:50 AM, Mike Schrag wrote:

2) Tags inside of tags (<td class = "<webobject name = "SomeClass"/>">).  This is EVIL.  The WOLips validator has also been yelling at you about this for months now, and that was very intentional.  If you listened to it, you're in a much better position for 5.4.  There is no automatic fix for this ... In fact, I would not be surprised that this will probably whack out the WOLips autoformatter and wobuilder cleaner.

As an aside to the main thread, what's the WO idiom for getting around this?  While WOLips accepts this:

<link href='<webobject name="myCSS"/>' rel="stylesheet" type="text/css"/>

(where myCSS refers to a WOResourceURL), and it builds and runs, it makes the XML purist inside me cringe.  JSP, for example, has the jsp:element/jsp:attribute elements with which you can build up an output element and its attributes dynamically.  Is there something analogous in WO?

Thanks for replies from Andrew, Miguel, Guido.

I started with:

<webobject name="css"/>

and:

css : WOGenericElement {
elementName = "link";
href = cssHref;
rel = "stylesheet";
type = "text/css";
}

but it wasn't clear to me how to get the WOResourceURL I had been using originally bound to 'href'.  I found the answer in the archives:

http://lists.apple.com/archives/Webobjects-dev/2004/Apr/msg00687.html

So I added a method to the Java:

    public String cssHref() {
    WOResourceManager rm = application().resourceManager();
    return rm.urlForResourceNamed("SMBS.css", null, null, context().request());
    }

Works as intended, and the XML no longer hurts my eyes.  :-)


-- 
Paul.

w  http://logicsquad.net/
h  http://paul.hoadley.name/


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Tags inside tags [was: Re: WebObjects 5.4 is out.] (From: Paul Hoadley <email@hidden>)

  • Prev by Date: Re: WebObjects Community Web site
  • Next by Date: Re: WebObjects Community Web site
  • Previous by thread: Re: Tags inside tags [was: Re: WebObjects 5.4 is out.]
  • Next by thread: Leopard Wolips Setup Problem...
  • Index(es):
    • Date
    • Thread