• 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: WOLIPS HTML parser problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WOLIPS HTML parser problem


  • Subject: Re: WOLIPS HTML parser problem
  • From: Ramsey Gurley <email@hidden>
  • Date: Fri, 02 May 2014 10:31:59 -0700

The WOComponent parser chokes because that is invalid XML and also a bad practice in general [much like using inline bindings and ognl :)] 

If you want to optionally include a div tag, there’s a dynamic element for that.  You should use WOGenericContainer with an omitTags binding on the condition.

SideMenuDiv: WOGenericContainer {
elementName = “div”;
omitTags = hasNoSideMenu;
}

The whole thing looks like it be refactored into a subcomponent that has WOComponentContent. Then you could use that with a WOSwitchComponent and switch out different components for side menu/no side menu.

Something like

—SideMenuWrapper.html
<div id="mainwrapper">
<webobject name=“SideMenu"/>
<div id="maincontent">
<webobject name=“Content”/>
</div>
</div>
—SideMenuWrapper.wod
Content: WOComponentContent {}
SideMenu: … and so on

—BlankWrapper.html
<webobject name=“Content”/>
—BlankWrapper.wod
Content: WOComponentContent {}

—SamplePage.html
<!DOCTYPE html>
<html>
<webobject name=“HeaderSection”/>
<webobject name=“Body”>
<div id=“wrapper”>
<webobject name=“TopMenuSection”/>
<webobject name=“SideMenuSwitch”>
<div id=“maincontent>
...
</div>
</webobject>

<webobject name=“BottomMenuSection”/>
</div>
</webobject>
</html>
—SamplePage.wod
SideMenuSwitch: WOSwitchComponent {
WOComponentName = menuWrapperName; //Returns either “SideMenuWrapper” or “BlankWrapper”
//…other bindings go here
}
…and so on


On May 2, 2014, at 9:52 AM, James Kevin Eaves <email@hidden> wrote:

I am trying to port my old WebObjects to Wonder/WOLips and am getting errors in the HTML.
The error is that about the <WEBOBJECTS>,  </WEBOBJECTS>, <DIV> and </DIV>  tag is missing.
First, the code is correct. I think that the parser is not pairing the correct open and close tags.
I am using Eclipse 4.3.2 and Wolips 4.3.2.
I have a lot of DIV and /DIV tags that are inside of conditional WEBOBJECTS tags.


Here is the sample code.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
   <WEBOBJECT NAME="HeaderSection"></WEBOBJECT>
  
   <WEBOBJECT NAME=Body1>  
  
      <div id="wrapper">
  
         <WEBOBJECT NAME="TopMenuSection"></WEBOBJECT>
        
         <WEBOBJECT NAME="HASSideMenuConditional">
            <div id="mainwrapper">
            <WEBOBJECT NAME="SideMenu"></WEBOBJECT>
        
            <div id="maincontent">  <---- ERROR Missing </div> tag
        
         </WEBOBJECT>
        
         <!-- Inform begin -->          
        
         <div id="maininfowrapper">
            <! -- some code goes here -->
         </div>
        
         <!-- Inform end -->
        
         <!-- Main end-->
         <WEBOBJECT NAME="HASSideMenuConditional">  <---- ERROR Missing <WEBOBJECT> tag
            </div> <!-- close maincontent>
            </div> <!-- close mainwrapper>
         </WEBOBJECT>
        
         <WEBOBJECT NAME="BottomMenuSection"></WEBOBJECT>
  
      </div><!--end wrapper-->  <---- <div> start tag is not found
  
      <WEBOBJECT NAME="FooterSection"></WEBOBJECT>
  
   </WEBOBJECT>  <---- <WEBOBJECT> start tag is not found

</html>


--
Kevin Eaves            <*}}}><
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: 
 >WOLIPS HTML parser problem (From: James Kevin Eaves <email@hidden>)

  • Prev by Date: WOLIPS HTML parser problem
  • Next by Date: Re: Fetch spec capabilities
  • Previous by thread: WOLIPS HTML parser problem
  • Next by thread: Re: Application startup time
  • Index(es):
    • Date
    • Thread