richter     00/05/24 01:47:34

  Modified:    .        Tag: Embperl2 Changes.pod Embperl.xs epcomp.c
                        epdom.c epdom.h epparse.c test.pl
               Embperl  Tag: Embperl2 Syntax.pm
               test/cmp Tag: Embperl2 escape.htm
               test/html Tag: Embperl2 escape.htm
  Log:
  Embperl 2 - Escaping, Tag Attributes
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.115.2.3 +10 -2     embperl/Changes.pod
  
  Index: Changes.pod
  ===================================================================
  RCS file: /home/cvs/embperl/Changes.pod,v
  retrieving revision 1.115.2.2
  retrieving revision 1.115.2.3
  diff -u -r1.115.2.2 -r1.115.2.3
  --- Changes.pod       2000/05/19 13:35:25     1.115.2.2
  +++ Changes.pod       2000/05/24 08:47:31     1.115.2.3
  @@ -2,6 +2,11 @@
   
   =head1 2.0b1_dev -- That's what currently under developement
   
  +Last Update: <$localtime$> (MET)
  +
  +NOTE: This version is only available via L<"CVS"|CVS/"INTRO">
  +
  +
      - "perl Makefile.PL debug" will build debugging information for
        gdb/ms-vc++ into Embperl library.
      - Output is 8Bit clean. Now you can output strings that contains
  @@ -22,10 +27,13 @@
        with other modules and to cascade multiple processors, that
        work on one document.
   
  +   - The following options can currently only set from the httpd.conf:
  +     optRawInput, optKeepSpaces, optDisableHtmlScan, optDisableTableScan,
  +     optDisableInputScan, optDisableMetaScan 
   
  -=head1 1.3b4_dev -- That's what currently under developement
   
  -Last Update: <$localtime$> (MET)
  +
  +=head1 1.3b4_dev -- That's what currently under developement
   
   NOTE: This version is only available via L<"CVS"|CVS/"INTRO">
   
  
  
  
  1.26.2.8  +49 -3     embperl/Embperl.xs
  
  Index: Embperl.xs
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl.xs,v
  retrieving revision 1.26.2.7
  retrieving revision 1.26.2.8
  diff -u -r1.26.2.7 -r1.26.2.8
  --- Embperl.xs        2000/05/23 16:00:42     1.26.2.7
  +++ Embperl.xs        2000/05/24 08:47:31     1.26.2.8
  @@ -607,15 +607,61 @@
   
   
   void
  -embperl_Node_replaceChildWithCDATA (xDomTree, xOldChild,sText,nEscMask)
  +embperl_Node_replaceChildWithCDATA (xDomTree, xOldChild,sText)
       int xDomTree
       int xOldChild
       SV * sText
  -    int nEscMask
   CODE:
       IV l ;
       char * s = SvPV (sText, l) ;
  -    Node_replaceChildWithCDATA (DomTree_self(xDomTree), -1, xOldChild, s, l, 
pCurrReq -> nCurrEscMode == 3?nEscMask:pCurrReq -> nCurrEscMode, nflgModified | 
nflgReturn) ;
  +    Node_replaceChildWithCDATA (DomTree_self(xDomTree), -1, xOldChild, s, l, 
(pCurrReq -> nCurrEscMode & 3)== 3?1 + (pCurrReq -> nCurrEscMode & 4):pCurrReq -> 
nCurrEscMode, nflgModified | nflgReturn) ;
  +    pCurrReq -> nCurrEscMode = pCurrReq -> nEscMode ;
  +    pCurrReq -> bEscModeSet = -1 ;
  +
  +
  +void
  +embperl_Node_replaceChildWithUrlDATA (xDomTree, xOldChild,sText)
  +    int xDomTree
  +    int xOldChild
  +    SV * sText
  +CODE:
  +    IV l ;
  +    char * s ;
  +    AV *   pAV ;    
  +    tDomTree * pDomTree = DomTree_self(xDomTree) ;
  +
  +    if (SvTYPE(sText) == SVt_RV && SvTYPE((pAV = (AV *)SvRV(sText))) == SVt_PVAV)
  +     { /* Array reference inside URL */
  +     SV ** ppSV ;
  +     int i ;
  +     int f = AvFILL(pAV)  ;
  +        tNode xNode ;
  +
  +        Node_replaceChildWithCDATA (DomTree_self(xDomTree), -1, xOldChild, "", 0, 
4, nflgModified | nflgReturn) ;
  +
  +     for (i = 0; i <= f; i++)
  +         {
  +         ppSV = av_fetch (pAV, i, 0) ;
  +         if (ppSV && *ppSV)
  +             {
  +             s = SvPV (*ppSV, l) ;
  +                xNode = Node_appendChild (pDomTree, ntypText, s, l, xOldChild, 0) ;
  +             if (pCurrReq -> nCurrEscMode & 2) 
  +                    Node_self (pDomTree, xNode) -> bFlags |= nflgEscUrl ;
  +                }
  +         if ((i & 1) == 0)
  +                Node_appendChild (pDomTree, ntypCDATA, "=", 1, xOldChild, 0) ;
  +         else if (i < f)
  +                Node_appendChild (pDomTree, ntypCDATA, "&", 1, xOldChild, 0) ;
  +         }
  +    
  +     }
  +    else
  +        {
  +        char * s = SvPV (sText, l) ;
  +        Node_replaceChildWithCDATA (DomTree_self(xDomTree), -1, xOldChild, s, l, 
(pCurrReq -> nCurrEscMode & 3) == 3?2 + (pCurrReq -> nCurrEscMode & 4):pCurrReq -> 
nCurrEscMode, nflgModified | nflgReturn) ;
  +        }
  +
       pCurrReq -> nCurrEscMode = pCurrReq -> nEscMode ;
       pCurrReq -> bEscModeSet = -1 ;
   
  
  
  
  1.1.2.12  +6 -7      embperl/Attic/epcomp.c
  
  Index: epcomp.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epcomp.c,v
  retrieving revision 1.1.2.11
  retrieving revision 1.1.2.12
  diff -u -r1.1.2.11 -r1.1.2.12
  --- epcomp.c  2000/05/23 16:00:47     1.1.2.11
  +++ epcomp.c  2000/05/24 08:47:31     1.1.2.12
  @@ -117,7 +117,7 @@
                    if (pChildNode)
                        StringAdd (&pCode, Node_selfNodeName(pChildNode), 0) ;
                    else
  -                     mydie ("missing child") ;                           
  +                     ; // mydie ("missing child") ;                      
                    }
                else if (p[1] == '$')
                    {
  @@ -136,7 +136,7 @@
                    if (p[1] == '!' || p[1] == '*')
                        {
                        pAttr = Element_selfGetAttribut (pDomTree, pNode, p + 2, q - p 
- 2) ;
  -                     if ((sVal && p[1] == '!') || (!sVal && p[1] == '*') )
  +                     if ((pAttr && p[1] == '!') || (!pAttr && p[1] == '*') )
                            {
                            valid = 0 ;
                            break ;
  @@ -145,14 +145,13 @@
                    else
                        pAttr = Element_selfGetAttribut (pDomTree, pNode, p + 1, q - p 
- 1) ;
                    
  -                    if (pAttr -> bFlags & aflgAttrValue)
  +                    if (!pAttr)
  +                     sVal = NULL ;
  +                 else if (pAttr -> bFlags & aflgAttrValue)
                           sVal = Ndx2String (pAttr -> xValue) ;
                       else
  -                        {
                           sVal = Node_selfNodeName (Node_selfFirstChild (pDomTree, 
(tNodeData *)pAttr)) ;
  -                        }
   
  -
                    if (sVal)
                        {
                        StringAdd (&pCode, sVal, 0) ; 
  @@ -343,7 +342,7 @@
        xNode = Node_firstChild (pDomTree, r -> xDocument) ;
   
        StringNew (&pProg, r -> Buf.pFile -> nFilesize / 4) ;
  -     StringAdd (&pProg, "my $_ep_DomTree = $_[1];\nmy $_ep_EscMask = 
5;\n*_ep_rp=\\&XML::Embperl::DOM::Node_replaceChildWithCDATA;\n*_ep_cp=\\&XML::Embperl::DOM::DomTree_checkpoint;\n
 ", 0) ;
  +     StringAdd (&pProg, "my $_ep_DomTree = $_[1];\nmy $_ep_EscMask = 
5;\n*_ep_rp=\\&XML::Embperl::DOM::Node_replaceChildWithCDATA;\n*_ep_rpurl=\\&XML::Embperl::DOM::Node_replaceChildWithUrlDATA;\n*_ep_cp=\\&XML::Embperl::DOM::DomTree_checkpoint;\n
 ", 0) ;
       
        while (xNode)
            {
  
  
  
  1.1.2.17  +55 -29    embperl/Attic/epdom.c
  
  Index: epdom.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epdom.c,v
  retrieving revision 1.1.2.16
  retrieving revision 1.1.2.17
  diff -u -r1.1.2.16 -r1.1.2.17
  --- epdom.c   2000/05/23 16:00:48     1.1.2.16
  +++ epdom.c   2000/05/24 08:47:31     1.1.2.17
  @@ -28,6 +28,8 @@
   int numStr    = 0 ;
   int numPads   = 0 ;
   
  +tIndex xNoName = 0 ;
  +
   #define dom_malloc(s)  (nMemUsage += s, malloc(s))
   
   /* ------------------------------------------------------------------------ */
  @@ -273,11 +275,9 @@
       HE *    pHEKey ;
       int          nNdx ;
       
  -    if ((ppSV = hv_fetch (pStringTableHash, (char *)sText, nLen, 1)) == NULL)
  -     return 0 ;
  -
  -    if (*ppSV != NULL && SvTYPE (*ppSV) == SVt_IV)
  -     return SvIV (*ppSV) ;
  +    if ((ppSV = hv_fetch (pStringTableHash, (char *)sText, nLen, 0)) != NULL)
  +     if (*ppSV != NULL && SvTYPE (*ppSV) == SVt_IV)
  +         return SvIV (*ppSV) ;
   
       /* new string */
        
  @@ -312,6 +312,7 @@
   
       ArrayNew (&pStringTableArray, 128, sizeof (HE *)) ; 
       String2Ndx ("", 0) ;
  +    xNoName = String2Ndx ("<noname>", 8) ;
   
       ArrayNew (&pDomTrees, 16, sizeof (tDomTree)) ; 
       ArrayAdd (&pDomTrees, 1) ;
  @@ -398,6 +399,8 @@
   
   int mydie (char *  msg)
       {
  +    strncpy (pCurrReq -> errdat1, msg, sizeof (pCurrReq -> errdat1)) ;
  +    LogError (pCurrReq, 9999) ;
       puts (msg) ;
       exit (1) ;
       }
  @@ -577,7 +580,7 @@
            /* lprintf (pCurrReq, "[%d]PARSE: NewPad Extent Attr: %d -> %d\n", 
pCurrReq -> nPid, pPad -> xParent, pNext -> xNdx) ; */
   
            if (nNodeSize + sizeof (struct tNodePad) >= nInitialNodePadSize)
  -             mydie ("pad too small for attpCurrReq -> make room") ;
  +             mydie ("pad too small for attr -> make room") ;
            
            pNext -> xPrev = pPad -> xNdx ;
            pPad  -> xNext = pNext -> xNdx ;
  @@ -596,7 +599,7 @@
           xNdx = ArrayAdd (&pDomTree -> pLookup, 1) ;
        pDomTree -> pLookup[xNdx] = (struct tNodeData *)pNew ;
   
  -     pNew -> xName  = String2Ndx (sText, nTextLen) ;
  +     pNew -> xName  = sText?String2Ndx (sText, nTextLen):nTextLen ;
        pNew -> xValue = 0 ;
        pNew -> bFlags = aflgOK ;
        pNew -> nType = nType ;
  @@ -607,31 +610,47 @@
        numAttr++ ;
   
        if (pCurrReq -> bDebug & dbgParse)
  -         lprintf (pCurrReq, "[%d]PARSE: AddNode: +%02d %*s Attribut parent=%d 
node=%d type=%d text=%*.*s (#%d)\n", pCurrReq -> nPid, nLevel, nLevel * 2, "", 
xParent, xNdx, nType, nTextLen, nTextLen, sText, sText?String2Ndx (sText, 
nTextLen):-1) ; 
  +         lprintf (pCurrReq, "[%d]PARSE: AddNode: +%02d %*s Attribut parent=%d 
node=%d type=%d text=%*.*s (#%d)\n", pCurrReq -> nPid, nLevel, nLevel * 2, "", 
xParent, xNdx, nType, nTextLen, nTextLen, sText?sText:Ndx2String (nTextLen), 
sText?String2Ndx (sText, nTextLen):nTextLen) ; 
   
        return xNdx ;
        }
  -    else if (nType == ntypAttrValue && (pParent -> bFlags & aflgAttrChilds) == 0)
  +    
  +    if (nType == ntypAttrValue && (pParent -> nType != ntypAttr || (pParent -> 
bFlags & aflgAttrChilds) == 0))
        {           
        struct tAttrData * pNew = (struct tAttrData * )pParent ; 
  -        if (pNew -> nType != ntypAttr)
  +        int bAddChild = 0 ;
  +     
  +     if (pNew -> nType != ntypAttr)
               {   
  -            if (!(xParent = Node_appendChild (pDomTree, ntypAttr, "a0", 2, xParent, 
nLevel)))
  -                return 0 ;
  -
  -         pNew = (struct tAttrData * )pDomTree -> pLookup[xParent] ; 
  -            }
  -        
  +         pNew = ((tAttrData *)(pParent + 1)) + pParent -> numAttr - 1 ;
  +         if (pParent -> numAttr == 0 || pNew -> xName != xNoName)
  +             {
  +             if (!(xParent = Node_appendChild (pDomTree, ntypAttr, NULL, xNoName, 
xParent, nLevel)))
  +                 return 0 ;
  +             nLevel++ ;
  +             pNew = (struct tAttrData * )pDomTree -> pLookup[xParent] ; 
  +             }
  +         else
  +             {
  +             xParent = pNew -> xNdx ;
  +             pParent = (tNodeData *)pNew ;
  +             bAddChild = 1 ;
  +             }
  +         }
           
           
  -        pNew -> xValue = String2Ndx (sText, nTextLen) ;
  -     if (pCurrReq -> bDebug & dbgParse)
  -         lprintf (pCurrReq, "[%d]PARSE: AddNode: +%02d %*s AttributValue parent=%d 
node=%d type=%d text=%*.*s (#%d)\n", pCurrReq -> nPid, nLevel, nLevel * 2, "", 
xParent, pNew -> xNdx, nType, nTextLen, nTextLen, sText, sText?String2Ndx (sText, 
nTextLen):-1) ; 
  -     pNew -> bFlags |= aflgAttrValue ;
  +        if (!bAddChild)
  +         {
  +         pNew -> xValue = String2Ndx (sText, nTextLen) ;
  +         if (pCurrReq -> bDebug & dbgParse)
  +             lprintf (pCurrReq, "[%d]PARSE: AddNode: +%02d %*s AttributValue 
parent=%d node=%d type=%d text=%*.*s (#%d)\n", pCurrReq -> nPid, nLevel, nLevel * 2, 
"", xParent, pNew -> xNdx, nType, nTextLen, nTextLen, sText, sText?String2Ndx (sText, 
nTextLen):-1) ; 
  +         pNew -> bFlags |= aflgAttrValue ;
   
  -     return xParent ;
  +         return xParent ;
  +         }
        }
  -    else
  +
  +    
        {
        struct tNodePad *   pChilds ;
        struct tNodeData *  pNew    ;
  @@ -800,7 +819,7 @@
        {
        pOldChild -> nType  = (nEscMode & 3)?ntypText:ntypCDATA ;
        pOldChild -> bFlags &= ~(nflgEscUrl + nflgEscChar) ;
  -     pOldChild -> bFlags |= (~nEscMode) & (nflgEscUrl + nflgEscChar) ;
  +     pOldChild -> bFlags |= (nEscMode ^ nflgEscChar) & (nflgEscUrl + nflgEscChar) ;
        }
       else
        pOldChild -> nType  = ntypCDATA ;
  @@ -1070,13 +1089,19 @@
                {
                char * s ;
                int    l ;
  -                Ndx2StringLen (pAttr -> xName,s,l) ;
  -             oputc (r, ' ') ;
  -             owrite (r, s, l);
  +                if (pAttr -> xName != xNoName || n + 1 == pNode -> numAttr)
  +                 oputc (r, ' ') ;
  +                if (pAttr -> xName != xNoName)
  +                 {
  +                 Ndx2StringLen (pAttr -> xName,s,l) ;
  +                 owrite (r, s, l);
  +                 }
   
                if (pAttr -> xValue)
                    {
  -                    oputs (r, "=\"") ;
  +                 if (pAttr -> xName != xNoName)
  +                     oputs (r, "=\"") ;
  +
                       if (pAttr -> bFlags & aflgAttrChilds)
                           {
                           Node_toString2 (pDomTree, r, pAttr -> xNdx, &nOrderNdx) ;
  @@ -1086,11 +1111,12 @@
                        Ndx2StringLen (pAttr -> xValue, s, l) ;
                        owrite (r, s, l) ;
                        }
  -                 oputc (r, '"') ;
  +                 if (pAttr -> xName != xNoName)
  +                     oputc (r, '"') ;
                       }
  +             pAttr++ ;
                }
            oputc (r, '>') ;
  -         pAttr++ ;
            }
        else if (pNode -> nType == ntypText)
            {
  
  
  
  1.1.2.13  +1 -0      embperl/Attic/epdom.h
  
  Index: epdom.h
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epdom.h,v
  retrieving revision 1.1.2.12
  retrieving revision 1.1.2.13
  diff -u -r1.1.2.12 -r1.1.2.13
  --- epdom.h   2000/05/23 16:00:49     1.1.2.12
  +++ epdom.h   2000/05/24 08:47:31     1.1.2.13
  @@ -151,6 +151,7 @@
   
   extern tDomTree  *    pDomTrees ;         /* Array with all Dom Trees */
   extern HE * *              pStringTableArray  ;   /* Array with pointers to strings 
*/
  +extern tIndex              xNoName ;              /* String index for Attribut with 
noname */
   
   
   
  
  
  
  1.1.2.15  +21 -16    embperl/Attic/epparse.c
  
  Index: epparse.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epparse.c,v
  retrieving revision 1.1.2.14
  retrieving revision 1.1.2.15
  diff -u -r1.1.2.14 -r1.1.2.15
  --- epparse.c 2000/05/23 16:00:50     1.1.2.14
  +++ epparse.c 2000/05/24 08:47:31     1.1.2.15
  @@ -27,7 +27,8 @@
       const char *         sNodeName;  /* name of the node to create */
       int                          nNodeName ; /* index in string table of node name 
*/
       enum tNodeType       nNodeType ; /* type of the node that should be created */
  -    enum tNodeType       nCDataType ;/* type of the node that should be created */
  +    enum tNodeType       nCDataType ;/* type for sub nodes that contains text */
  +    enum tNodeType       nForceType ;/* force this type for sub nodes */
       int                          bUnescape ; /* translate input?  */
       unsigned char *      pContains ; /* chars that could becontains in the string */
       struct tTokenTable *    pFollowedBy;/* table of tokens that can follow this one 
*/
  @@ -292,6 +293,7 @@
            p -> nNodeType = GetHashValueInt (pHash, "nodetype", ntypTag) ;
            p -> bUnescape = GetHashValueInt (pHash, "unescape", 0) ;
            p -> nCDataType = GetHashValueInt (pHash, "cdatatype", ntypCDATA) ;
  +         p -> nForceType = GetHashValueInt (pHash, "forcetype", 0) ;
            p -> pEndTag    = (struct tToken *)GetHashValueStr (pHash, "endtag", NULL) 
;
            if (sContains  = GetHashValueStr (pHash, "contains", NULL))
                {
  @@ -431,6 +433,7 @@
                       const char *          sEndText,
                       const char *          pParentContains,
                    enum tNodeType        nCDataType,
  +                 enum tNodeType        nForceType,
                    int                   bUnescape,
                    const char *          pParentNodeName,
                    tNode                 xParentNode,
  @@ -449,7 +452,7 @@
           {
        struct tToken *     pToken          = NULL ;
           if (pStartChars [*pCurr >> 3] & 1 << (*pCurr & 7))
  -            {
  +            { /* valid token start char found */
            struct tTokenTable *    pNextTokenTab   = pTokenTable ;
            const char *            pNodeName       = NULL ;
            enum tNodeType          nNodeType       = 0 ;
  @@ -463,7 +466,7 @@
                unsigned char * pAllChars = pNextTokenTab -> cAllChars ;
   
                if (pNextTokenTab -> bLSearch)
  -                 {
  +                 { /* search linear thru the tokens */
                    int r = 1 ;
                    int i ;
   
  @@ -479,7 +482,7 @@
                        pCurr += pToken -> nTextLen ;
                    }
                else
  -                 {
  +                 { /* do a binary search for tokens */
                    c.pStart = pCurr ;
   
                    while (pAllChars [*pCurr >> 3] & (1 << (*pCurr & 7)))
  @@ -491,8 +494,9 @@
   
                if (pToken)
                       {
  -                    while (isspace (*pCurr))
  -                        pCurr++ ;
  +                 if (pToken -> nNodeType != ntypCDATA)
  +                     while (isspace (*pCurr))
  +                         pCurr++ ;
   
                       if (pToken -> sNodeName)
                        pNodeName = pToken -> sNodeName ;
  @@ -506,13 +510,13 @@
               while (pNextTokenTab = pToken -> pFollowedBy) ;
               
               if (pToken)
  -                {        
  +                { /* matching token found */       
                   struct tTokenTable * pInside ;                
   
                if (pCurrStart < pCurrTokenStart)
                    {
                    if (nCDataType)
  -                     {
  +                     { /* add text before current token as node */
                        if (bUnescape)
                               {
                               r -> bEscInUrl = bUnescape - 1 ;
  @@ -530,13 +534,13 @@
                    pNodeName = pToken -> sText ;
                
                if (pToken -> nNodeType == ntypEndTag && level > 0)
  -                 {
  +                 { /* end token found */
                    char * pEndCurr = strstr (pCurr, pToken -> sEndText) ;
                       if (pEndCurr)
  -                     {
  +                     { 
                        tNode xNewAttrNode ;
                           if (pEndCurr - pCurr && pToken -> nCDataType && pToken -> 
nCDataType != ntypCDATA)
  -                         {
  +                         { /* add text before end of token as node */
                            if (pToken -> bUnescape)
                                   {
                                   r -> bEscInUrl = pToken -> bUnescape - 1 ;
  @@ -559,15 +563,16 @@
                        xParentNode = Node_parentNode  (r -> pCurrDomTree, 
xParentNode) ;
                        level-- ;
                        }
  -                 if (!(xNewNode = Node_appendChild (r -> pCurrDomTree, pToken -> 
nNodeType, pNodeName, strlen (pNodeName), xParentNode, level)))
  +                 /* add token as node */
  +                 if (!(xNewNode = Node_appendChild (r -> pCurrDomTree, nForceType 
&& pToken -> nNodeType != ntypAttr?nForceType:pToken -> nNodeType, pNodeName, strlen 
(pNodeName), xParentNode, level)))
                        return rc ;
                    
                    if (pInside = pToken -> pInside)
  -                     {
  -                     ParseTokens (r, &pCurr, pEnd, pInside, pToken -> sEndText, 
pToken -> pContains, pToken -> nCDataType, pToken -> bUnescape, pNodeName, xNewNode, 
level+1) ;
  +                     { /* parse for further tokens inside of this token */
  +                     ParseTokens (r, &pCurr, pEnd, pInside, pToken -> sEndText, 
pToken -> pContains, pToken -> nCDataType, pToken -> nForceType, pToken -> bUnescape, 
pNodeName, xNewNode, level+1) ;
                        }    
                    else
  -                     {
  +                     { /* nothing more inside of this token allowed, so search for 
the end of the token */
                        char * pEndCurr ;
                        unsigned char * pContains ;
                        int nSkip ;
  @@ -674,7 +679,7 @@
       if (!(xDocNode = Node_appendChild (r -> pCurrDomTree,  ntypTag, "doc", 3, 0, 
0)))
        return 1 ;
       
  -    if ((rc = ParseTokens (r, &pStart, pEnd, r -> pTokenTable, "", NULL, ntypCDATA, 
0, "root", xDocNode, 0)) != ok)
  +    if ((rc = ParseTokens (r, &pStart, pEnd, r -> pTokenTable, "", NULL, ntypCDATA, 
0, 0, "root", xDocNode, 0)) != ok)
        return rc ; 
   
       r -> pCurrDomTree -> xDocument = xDocNode ;
  
  
  
  1.57.2.10 +1 -1      embperl/test.pl
  
  Index: test.pl
  ===================================================================
  RCS file: /home/cvs/embperl/test.pl,v
  retrieving revision 1.57.2.9
  retrieving revision 1.57.2.10
  diff -u -r1.57.2.9 -r1.57.2.10
  --- test.pl   2000/05/23 16:00:53     1.57.2.9
  +++ test.pl   2000/05/24 08:47:31     1.57.2.10
  @@ -29,7 +29,7 @@
       'varerr.htm???-1',
   ##    'varerr.htm???2',
       'escape.htm',
  -    'spaces.htm',
  +##    'spaces.htm',
       'tagscan.htm',
       'tagscan.htm??1',
       'if.htm',
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.6   +48 -10    embperl/Embperl/Attic/Syntax.pm
  
  Index: Syntax.pm
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl/Attic/Syntax.pm,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- Syntax.pm 2000/05/23 16:01:25     1.1.2.5
  +++ Syntax.pm 2000/05/24 08:47:32     1.1.2.6
  @@ -10,7 +10,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: Syntax.pm,v 1.1.2.5 2000/05/23 16:01:25 richter Exp $
  +#   $Id: Syntax.pm,v 1.1.2.6 2000/05/24 08:47:32 richter Exp $
   #
   ###################################################################################
   
  @@ -65,6 +65,8 @@
       '-lsearch' => 1,
       'Embperl command escape' => {
           'text' => '[[',
  +        'nodename' => '[',
  +        'nodetype' => ntypCDATA,
           },
       'Embperl meta command' => {
           'text' => '[$',
  @@ -78,7 +80,7 @@
           'unescape' => 1,
           'procinfo' => {
               embperl => { 
  -                    perlcode => '_ep_rp(%$n%,scalar(do{%#0%}), 6);', 
  +                    perlcode => '_ep_rp(%$n%,scalar(do{%#0%}));', 
                       removenode  => 4,
                       }
               },
  @@ -118,7 +120,7 @@
   clonehash (\%Cmds, \%CmdsLink, { 'unescape' => 2 }) ;
   
   $CmdsLink{'Embperl output code'}{'nodename'} = '[+url' ;
  -$CmdsLink{'Embperl output code'}{'procinfo'}{'embperl'}{'perlcode'} = 
'_ep_rp(%$n%,scalar(do{%#0%}), 5);' ;
  +$CmdsLink{'Embperl output code'}{'procinfo'}{'embperl'}{'perlcode'} = 
'_ep_rpurl(%$n%,scalar(do{%#0%}));' ;
   
   
   
  @@ -188,7 +190,8 @@
   %HtmlTags = (
       'input' => {
           'text' => 'input',
  -        'cdatatype'  => 0,
  +        'forcetype'  => ntypAttrValue,
  +        'cdatatype'  => ntypAttrValue,
           'inside' => 
               {
               'type'  => { 'text' => 'type',  'nodename' => 'type',  follow => 
\%AssignAttr },
  @@ -202,26 +205,38 @@
       'tr' => {
           'text' => 'tr',
           'nodetype'   => ntypStartTag, 
  +        'forcetype'  => ntypAttrValue,
  +        'cdatatype'  => ntypAttrValue,
            },
       '/tr' => {
           'text' => '/tr',
           'nodetype'   => ntypEndTag, 
  +        'forcetype'  => ntypAttrValue,
  +        'cdatatype'  => ntypAttrValue,
            },
       'table' => {
           'text' => 'table',
           'nodetype'   => ntypStartTag, 
  +        'forcetype'  => ntypAttrValue,
  +        'cdatatype'  => ntypAttrValue,
            },
       '/table' => {
           'text' => '/table',
           'nodetype'   => ntypEndTag, 
  +        'forcetype'  => ntypAttrValue,
  +        'cdatatype'  => ntypAttrValue,
            },
       'th' => {
           'text' => 'th',
           'nodetype'   => ntypStartTag, 
  +        'forcetype'  => ntypAttrValue,
  +        'cdatatype'  => ntypAttrValue,
            },
       '/th' => {
           'text' => '/th',
           'nodetype'   => ntypEndTag, 
  +        'forcetype'  => ntypAttrValue,
  +        'cdatatype'  => ntypAttrValue,
            },
       'select' => {
           'text' => 'select',
  @@ -230,6 +245,8 @@
               'name'  => { 'text' => 'name',  'nodename' => 'name', follow => 
\%AssignAttr },
               },
           'nodetype'   => ntypStartTag, 
  +        'forcetype'  => ntypAttrValue,
  +        'cdatatype'  => ntypAttrValue,
            },
       'option' => {
           'text' => 'option',
  @@ -238,45 +255,66 @@
               'value' => { 'text' => 'value', 'nodename' => 'value', follow => 
\%AssignAttr },
               },
           'nodetype'   => ntypStartTag, 
  +        'forcetype'  => ntypAttrValue,
  +        'cdatatype'  => ntypAttrValue,
            },
       '/option' => {
           'text' => '/option',
           'nodetype'   => ntypEndTag, 
  +        'forcetype'  => ntypAttrValue,
  +        'cdatatype'  => ntypAttrValue,
            },
       '/select' => {
           'text' => '/select',
           'nodetype'   => ntypEndTag, 
  +        'forcetype'  => ntypAttrValue,
  +        'cdatatype'  => ntypAttrValue,
            },
       'body' => {
           'text' => 'body',
  +        'forcetype'  => ntypAttrValue,
  +        'cdatatype'  => ntypAttrValue,
            },
       'a' => {
           'text' => 'a',
  +        'forcetype'  => ntypAttrValue,
           'cdatatype'  => ntypAttrValue,
           'inside' => \%HrefLink,
            },
       'frame' => {
           'text' => 'frame',
           'inside' => \%SrcLink,
  +        'forcetype'  => ntypAttrValue,
  +        'cdatatype'  => ntypAttrValue,
            },
       'iframe' => {
           'text' => 'iframe',
           'inside' => \%SrcLink,
  +        'forcetype'  => ntypAttrValue,
  +        'cdatatype'  => ntypAttrValue,
            },
       'embed' => {
           'text' => 'embed',
  +        'forcetype'  => ntypAttrValue,
  +        'cdatatype'  => ntypAttrValue,
           'inside' => \%SrcLink,
            },
       'layer' => {
           'text' => 'layer',
  +        'forcetype'  => ntypAttrValue,
  +        'cdatatype'  => ntypAttrValue,
           'inside' => \%SrcLink,
            },
       'img' => {
           'text' => 'img',
  +        'forcetype'  => ntypAttrValue,
  +        'cdatatype'  => ntypAttrValue,
           'inside' => \%SrcLink,
            },
       'form' => {
           'text' => 'form',
  +        'forcetype'  => ntypAttrValue,
  +        'cdatatype'  => ntypAttrValue,
           'inside' => \%ActionLink,
            },
   
  @@ -292,7 +330,7 @@
           'endtag'   => 'endif',
           'procinfo' => {
               embperl => { 
  -                perlcode => 'if (%a0%) { ', 
  +                perlcode => 'if (%<noname>%) { ', 
                   perlcodeend => '}',
                   removenode => 10,
                   }
  @@ -330,7 +368,7 @@
           'endtag'   => 'endif',
           'procinfo' => {
               embperl => { 
  -                perlcode => 'elsif (%a0%) { ', 
  +                perlcode => 'elsif (%<noname>%) { ', 
                   perlcodeend => '}',
                   removenode => 10,
                   }
  @@ -344,7 +382,7 @@
           'endtag'   => 'endwhile',
           'procinfo' => {
               embperl => { 
  -                perlcode => 'while (%a0%) { ', 
  +                perlcode => 'while (%<noname>%) { ', 
                   perlcodeend => '}',
                   removenode => 10,
                   }
  @@ -366,7 +404,7 @@
           'endtag'   => 'endforeach',
           'procinfo' => {
               embperl => { 
  -                perlcode => 'foreach %a0% { ', 
  +                perlcode => 'foreach %<noname>% { ', 
                   perlcodeend => '}',
                   removenode => 10,
                   }
  @@ -388,7 +426,7 @@
           'procinfo' => {
               embperl => { 
                   perlcode => 'do { ', 
  -                perlcodeend => '} until (%a0%) ; ',
  +                perlcodeend => '} until (%<noname>%) ; ',
                   removenode => 10,
                   }
               },
  @@ -408,7 +446,7 @@
           'unescape' => 1,
           'procinfo' => {
               embperl => { 
  -                perlcode => 'use strict ; use vars qw {%a0%} ;', 
  +                perlcode => 'use strict ; use vars qw {%<noname>%} ;', 
                   removenode => 3,
                   }
               },
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.15.2.1  +57 -129   embperl/test/cmp/escape.htm
  
  Index: escape.htm
  ===================================================================
  RCS file: /home/cvs/embperl/test/cmp/escape.htm,v
  retrieving revision 1.15
  retrieving revision 1.15.2.1
  diff -u -r1.15 -r1.15.2.1
  --- escape.htm        2000/05/02 04:41:41     1.15
  +++ escape.htm        2000/05/24 08:47:33     1.15.2.1
  @@ -20,16 +20,16 @@
   What is the EscMode? 3
   Now a Url: <A 
HREF="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This+is+a+text+%3F+%26+%2B+-+%2521">Here
 it goes</A>
   A Tag 2:   <A 
HREF="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This+is+a+text+%3F+%26+%2B+-+%2521"
 TARGET="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This is a text ? 
&amp; + - %21">a2</A>
  -A Tag 3:   <A  
TARGET="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This is a text ? 
&amp; + - %21" 
HREF="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This+is+a+text+%3F+%26+%2B+-+%2521"
 TARGET="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This is a text ? 
&amp; + - %21">a3</A>
  -A Tag 4:   <A 
TARGET="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This is a text ? 
&amp; + - %21" 
HREF="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This+is+a+text+%3F+%26+%2B+-+%2521">a4</A>
  -A Tag 5:   <A  
TARGET="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This is a text ? 
&amp; + - %21">a5</A>
  -A Tag 6:   <A >a6</A>
  -A Tag 7:   <A  HREF="7">x</A>
  -A Tag 8:   <A TARGET=8 HREF="8">x</A>
  +A Tag 3:   <A 
TARGET="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This is a text ? 
&amp; + - %21"  
HREF="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This+is+a+text+%3F+%26+%2B+-+%2521"
 TARGET="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This is a text ? 
&amp; + - %21">a3</A>
  +A Tag 4:   <A 
TARGET="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This is a text ? 
&amp; + - %21"  
HREF="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This+is+a+text+%3F+%26+%2B+-+%2521">a4</A>
  +A Tag 5:   <A 
TARGET="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This is a text ? 
&amp; + - %21">a5</A>
  +A Tag 6:   <A>a6</A>
  +A Tag 7:   <A HREF="7">x</A>
  +A Tag 8:   <A TARGET=8  HREF="8">x</A>
   A Tag 9:   <A HREF="9" TARGET="9">x</A>
  -A Tag 10:  <A TARGET="10" HREF="10" TARGET="10">x</A>
  -A Tag 11:  <A  HREF="11"  >x</A>
  -A Tag 12:  <A HREF=12>x</A>
  +A Tag 10:  <A TARGET="10"  HREF="10" TARGET="10">x</A>
  +A Tag 11:  <A HREF="11"  >x</A>
  +A Tag 12:  <A HREF="12">x</A>
   A Tag 13:  <A HREF="abcd%20%3E">x</A>
   A Tag 14:  <A HREF="abcd%20%3E">x</A>
   FRAME:          <FRAME 
SRC="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This+is+a+text+%3F+%26+%2B+-+%2521"
  name="%20foo">
  @@ -78,37 +78,58 @@
   (this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+    
<a&gt;<BR>
   (this+is+the+value+in+$a)+������%3F%3F%3F%3C%26%2B++++<a%3E<BR>
   (this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+    
<a&gt;<BR>
  -(this is the value in $a) ������???<&+    \<a><BR>
  -(this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+    
\&lt;a&gt;<BR>
  -(this+is+the+value+in+$a)+������%3F%3F%3F%3C%26%2B++++\%3Ca%3E<BR>
  -(this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+    
\&lt;a&gt;<BR>
  -
  -Same without local:
  -(this is the value in $a) ������???<&+    \<a><BR>
  -(this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+    
<a&gt;<BR>
  -(this+is+the+value+in+$a)+������%3F%3F%3F%3C%26%2B++++<a%3E<BR>
  -(this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+    
<a&gt;<BR>
  -(this is the value in $a) ������???<&+    \<a><BR>
  -(this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+    
\&lt;a&gt;<BR>
  -(this+is+the+value+in+$a)+������%3F%3F%3F%3C%26%2B++++\%3Ca%3E<BR>
  -(this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+    
\&lt;a&gt;<BR>
  -
  -
  -Control Chars 0x80-0x9f:
  
-&#128;&#129;&#130;&#131;&#132;&#133;&#134;&#135;&#136;&#137;&#138;&#139;&#140;&#141;&#142;&#143;&#144;&#145;&#146;&#147;&#148;&#149;&#150;&#151;&#152;&#153;&#154;&#155;&#156;&#157;&#158;&#159;&nbsp;<BR>

  -
  -Control Chars 129 & 130:
  -&amp;#129;&amp;#130;<BR>
  +(this is the value in $a) ������???<&+    \<a><BR>
  +
  +(this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+    
\&lt;a&gt;<BR>
  +
  +(this+is+the+value+in+$a)+������%3F%3F%3F%3C%26%2B++++\%3Ca%3E<BR>
  +
  +(this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+    
\&lt;a&gt;<BR>
  +
  +
  +
  +Same without local:
  +
  +(this is the value in $a) ������???<&+    \<a><BR>
  +
  +(this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+    
<a&gt;<BR>
  +
  +(this+is+the+value+in+$a)+������%3F%3F%3F%3C%26%2B++++<a%3E<BR>
  +
  +(this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+    
<a&gt;<BR>
  +
  +(this is the value in $a) ������???<&+    \<a><BR>
  +
  +(this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+    
\&lt;a&gt;<BR>
   
  +(this+is+the+value+in+$a)+������%3F%3F%3F%3C%26%2B++++\%3Ca%3E<BR>
  +
  +(this is the value in $a) &auml;&ouml;&uuml;&auml;&ouml;&uuml;???&lt;&amp;+    
\&lt;a&gt;<BR>
  +
  +
  +
  +
  +
  +Control Chars 0x80-0x9f:
  +
  
+&#128;&#129;&#130;&#131;&#132;&#133;&#134;&#135;&#136;&#137;&#138;&#139;&#140;&#141;&#142;&#143;&#144;&#145;&#146;&#147;&#148;&#149;&#150;&#151;&#152;&#153;&#154;&#155;&#156;&#157;&#158;&#159;&nbsp;<BR>
  +
  +
  +
  +Control Chars 129 & 130:
  +
  +&amp;#129;&amp;#130;<BR>
  +
  +
   0
  -<A HREF='http://host/script?name=My+Name+���'>
  +<A HREF="http://host/script?name=My+Name+���">
   
  -<A HREF='http://host/script?name=My+Name+���'>
  +<A HREF="http://host/script?name=My+Name+���">
   
   0
  -<A HREF='http://host/script?name=My+Name+���'>
  +<A HREF="http://host/script?name=My+Name+���">
   
  -<A HREF='http://host/script?name=My Name ���'>
  +<A HREF="http://host/script?name=My Name ���">
   
   <br>
   
  @@ -117,103 +138,10 @@
   
   This should also work for [* foo *]  <br>
   
  -
  -<A HREF="abcd%20>">x</A>
  -
  -<table>
  -<TR>
  - <TD><a href="1">Link</a></TD>
  -</TR>
  -
  -<TR>
  - <TD><a href="2">Link</a></TD>
  -</TR>
  -
  -<TR>
  - <TD><a href="3">Link</a></TD>
  -</TR>
  -</table>
  -
  -<table>
  -<TR>
  - <TD><a href="1">Link</a></TD>
  -</TR>
  -
  -<TR>
  - <TD><a href="2">Link</a></TD>
  -</TR>
  -
  -<TR>
  - <TD><a href="3">Link</a></TD>
  -</TR>
  -</table>
  -
  -
  -
  -
  -$optRawInput  0
  -$escmode      0
  -'here is a \ '              -> here is a \ 
  -'here is a \\ '             -> here is a \ 
  -'here is a \\\ '            -> here is a \\ 
  -'here is a \\\\ '           -> here is a \\ 
  -'here is a <tag> '          -> here is a 
  -'here is a \<tag> '         -> here is a <tag>
  -'here is a \\<tag> '        -> here is a \<tag>
  -'here is a \\\<tag> '       -> here is a \<tag>
  -'here is a \\\\<tag> '      -> here is a \\<tag>
  -'here is a \<tag\> '        -> here is a <tag\>
  -'here is a \\<tag\\> '      -> here is a \<tag\>
  -'here is a \\\<tag\\\> '    -> here is a \<tag\\>
  -'here is a \\\\<tag\\\\> '  -> here is a \\<tag\\>
  -$optRawInput  1
  -$escmode      0
  -'here is a \ '              -> here is a \ 
  -'here is a \\ '             -> here is a \ 
  -'here is a \\\ '            -> here is a \\ 
  -'here is a \\\\ '           -> here is a \\ 
  -'here is a <tag> '          -> here is a <tag>
  -'here is a \<tag> '         -> here is a \<tag>
  -'here is a \\<tag> '        -> here is a \<tag>
  -'here is a \\\<tag> '       -> here is a \\<tag>
  -'here is a \\\\<tag> '      -> here is a \\<tag>
  -'here is a \<tag\> '        -> here is a \<tag\>
  -'here is a \\<tag\\> '      -> here is a \<tag\>
  -'here is a \\\<tag\\\> '    -> here is a \\<tag\\>
  -'here is a \\\\<tag\\\\> '  -> here is a \\<tag\\>
  -$optRawInput  0
  -$escmode      1
  -'here is a \ '              -> here is a  
  -'here is a \\ '             -> here is a  
  -'here is a \\\ '            -> here is a \ 
  -'here is a \\\\ '           -> here is a \ 
  -'here is a <tag> '          -> here is a 
  -'here is a \<tag> '         -> here is a &lt;tag&gt;
  -'here is a \\<tag> '        -> here is a <tag&gt;
  -'here is a \\\<tag> '       -> here is a <tag&gt;
  -'here is a \\\\<tag> '      -> here is a \&lt;tag&gt;
  -'here is a \<tag\> '        -> here is a &lt;tag>
  -'here is a \\<tag\\> '      -> here is a <tag>
  -'here is a \\\<tag\\\> '    -> here is a <tag\&gt;
  -'here is a \\\\<tag\\\\> '  -> here is a \&lt;tag\&gt;
  -$optRawInput  1
  -$escmode      1
  -'here is a \ '              -> here is a  
  -'here is a \\ '             -> here is a  
  -'here is a \\\ '            -> here is a \ 
  -'here is a \\\\ '           -> here is a \ 
  -'here is a <tag> '          -> here is a &lt;tag&gt;
  -'here is a \<tag> '         -> here is a <tag&gt;
  -'here is a \\<tag> '        -> here is a <tag&gt;
  -'here is a \\\<tag> '       -> here is a \&lt;tag&gt;
  -'here is a \\\\<tag> '      -> here is a \&lt;tag&gt;
  -'here is a \<tag\> '        -> here is a <tag>
  -'here is a \\<tag\\> '      -> here is a <tag>
  -'here is a \\\<tag\\\> '    -> here is a \&lt;tag\&gt;
  -'here is a \\\\<tag\\\\> '  -> here is a \&lt;tag\&gt;
   <P>Ok.<P>
   
   
   </body>
   </html>
  -
  +
  +
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.11.2.2  +2 -2      embperl/test/html/escape.htm
  
  Index: escape.htm
  ===================================================================
  RCS file: /home/cvs/embperl/test/html/escape.htm,v
  retrieving revision 1.11.2.1
  retrieving revision 1.11.2.2
  diff -u -r1.11.2.1 -r1.11.2.2
  --- escape.htm        2000/05/23 16:01:41     1.11.2.1
  +++ escape.htm        2000/05/24 08:47:34     1.11.2.2
  @@ -170,7 +170,7 @@
   
   This should also work for [[* foo *]  <br>
   
  -
  +[#
   <A HREF="[+ "abcd"+]%20[+ "%3e" +]">x</A>
   
   [- $dat = [[1], [2], [3]] -]
  @@ -262,8 +262,8 @@
   'here is a \\<tag\\> '      -> [+ 'here is a \\<tag\\>' +]
   'here is a \\\<tag\\\> '    -> [+ 'here is a \\\<tag\\\>' +]
   'here is a \\\\<tag\\\\> '  -> [+ 'here is a \\\\<tag\\\\>' +]
  -
   
  +#]
   <P>Ok.<P>
   
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to