public void startElement()

in core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/xml/xlink/XLinkPipe.java [62:185]


    public void startElement( String uri, String name, String raw, Attributes attr ) throws SAXException
    {
        String type = attr.getValue( XLINK_NAMESPACE_URI, XLINK_TYPE );
        if ( type != null )
        {
            if ( type.equals( XLINK_TYPE_SIMPLE ) )
            {
                if ( this.extendedLinkElementName != null )
                {
                    throw new SAXException( "An XLink simple link cannot be included into an 'extended' element" );
                }
                else if ( this.linkLocatorElementName != null )
                {
                    throw new SAXException( "An XLink simple link cannot be included into a 'locator' element" );
                }
                else if ( this.linkArcElementName != null )
                {
                    throw new SAXException( "An XLink simple link cannot be included into an 'arc' element" );
                }
                String href = attr.getValue( XLINK_NAMESPACE_URI, XLINK_HREF );
                String role = attr.getValue( XLINK_NAMESPACE_URI, XLINK_ROLE );
                String arcrole = attr.getValue( XLINK_NAMESPACE_URI, XLINK_ARCROLE );
                String title = attr.getValue( XLINK_NAMESPACE_URI, XLINK_TITLE );
                String show = attr.getValue( XLINK_NAMESPACE_URI, XLINK_SHOW );
                String actuate = attr.getValue( XLINK_NAMESPACE_URI, XLINK_ACTUATE );
                simpleLink( href, role, arcrole, title, show, actuate, uri, name, raw, attr );
            }
            else if ( type.equals( XLINK_TYPE_EXTENDED ) )
            {
                if ( this.extendedLinkElementName != null )
                {
                    throw new SAXException( "An XLink extended link cannot include another 'extended' element" );
                }
                else if ( this.linkLocatorElementName != null )
                {
                    throw new SAXException( "An XLink extended link cannot be included into a 'locator' element" );
                }
                else if ( this.linkArcElementName != null )
                {
                    throw new SAXException( "An XLink extended link cannot be included into an 'arc' element" );
                }
                String role = attr.getValue( XLINK_NAMESPACE_URI, XLINK_ROLE );
                String title = attr.getValue( XLINK_NAMESPACE_URI, XLINK_TITLE );
                this.extendedLinkElementName = name;
                this.extendedLinkElementURI = uri;
                startExtendedLink( role, title, uri, name, raw, attr );
            }
            else if ( type.equals( XLINK_TYPE_LOCATOR ) )
            {
                if ( this.extendedLinkElementName == null )
                {
                    throw new SAXException( "An XLink locator must be included into an 'extended' element" );
                }
                else if ( this.linkLocatorElementName != null )
                {
                    throw new SAXException( "An XLink locator  cannot be included into another 'locator' element" );
                }
                else if ( this.linkArcElementName != null )
                {
                    throw new SAXException( "An XLink locator cannot be included into an 'arc' element" );
                }
                String href = attr.getValue( XLINK_NAMESPACE_URI, XLINK_HREF );
                String role = attr.getValue( XLINK_NAMESPACE_URI, XLINK_ROLE );
                String title = attr.getValue( XLINK_NAMESPACE_URI, XLINK_TITLE );
                String label = attr.getValue( XLINK_NAMESPACE_URI, XLINK_LABEL );
                this.linkLocatorElementName = name;
                this.linkLocatorElementURI = uri;
                startLocator( href, role, title, label, uri, name, raw, attr );
            }
            else if ( type.equals( XLINK_TYPE_ARC ) )
            {
                if ( this.extendedLinkElementName == null )
                {
                    throw new SAXException( "An XLink arc must be included into an 'extended' element" );
                }
                else if ( this.linkLocatorElementName != null )
                {
                    throw new SAXException( "An XLink arc cannot be included into a 'locator' element" );
                }
                else if ( this.linkArcElementName != null )
                {
                    throw new SAXException( "An XLink arc cannot be included into another 'arc' element" );
                }
                String arcrole = attr.getValue( XLINK_NAMESPACE_URI, XLINK_ARCROLE );
                String title = attr.getValue( XLINK_NAMESPACE_URI, XLINK_TITLE );
                String show = attr.getValue( XLINK_NAMESPACE_URI, XLINK_SHOW );
                String actuate = attr.getValue( XLINK_NAMESPACE_URI, XLINK_ACTUATE );
                String from = attr.getValue( XLINK_NAMESPACE_URI, XLINK_FROM );
                String to = attr.getValue( XLINK_NAMESPACE_URI, XLINK_TO );
                this.linkArcElementName = name;
                this.linkArcElementURI = uri;
                startArc( arcrole, title, show, actuate, from, to, uri, name, raw, attr );
            }
            else if ( type.equals( XLINK_TYPE_RESOURCE ) )
            {
                if ( this.extendedLinkElementName == null )
                {
                    throw new SAXException( "An XLink resource must be included into an 'extended' element" );
                }
                String role = attr.getValue( XLINK_NAMESPACE_URI, XLINK_ROLE );
                String title = attr.getValue( XLINK_NAMESPACE_URI, XLINK_TITLE );
                String label = attr.getValue( XLINK_NAMESPACE_URI, XLINK_LABEL );
                linkResource( role, title, label, uri, name, raw, attr );
            }
            else if ( type.equals( XLINK_TYPE_TITLE ) )
            {
                if ( ( this.extendedLinkElementName == null )
                        && ( this.linkLocatorElementName == null )
                        && ( this.linkArcElementName == null ) )
                {
                    throw new SAXException( "An XLink title must be included into an 'extended', 'locator' or 'arc' element" );
                }
                linkTitle( uri, name, raw, attr );
            }
            else
            {
                super.startElement( uri, name, raw, attr );
            }
        }
        else
        {
            super.startElement( uri, name, raw, attr );
        }
    }