\documentclass[12pt]{jarticle}
\usepackage[pagewise]{lineno}
\linenumbers
\usepackage{xr}
\makeatletter
\let\XR@prefix\@empty
\def\@LN#1#2{{%
   \expandafter\@@LN
      \csname \XR@prefix LN@P#2C\@LN@column\expandafter\endcsname
      \csname \XR@prefix LN@PO#2\endcsname
      {#1}{#2}}}
\def\@@LN#1#2#3#4{\ifx#1\relax
    \ifx#2\relax\gdef#2{#3}\fi
    \expandafter\@@@LN
       \csname
          \XR@prefix LN@P\csname \XR@prefix LastNumberedPage\endcsname
       \endcsname#1% 
    \xdef#1{\lastLN{#3}\firstLN{#3}% 
            \pageLN{#4}{\@LN@column}{#2}\nextLN\relax}%
  \else
    \def\lastLN##1{\noexpand\lastLN{#3}}%
    \xdef#1{#1}%
  \fi
  \expandafter\xdef\csname \XR@prefix LastNumberedPage\endcsname{%
     #4C\@LN@column}}
\def\getpagewiselinenumber@XR#1#2{{%
   \let\@saved@NumberedPageCache\NumberedPageCache
   \let\@saved@LN@Pfirst\LN@Pfirst
   \global\expandafter\let\expandafter\NumberedPageCache
      \csname #1NumberedPageCache\endcsname
   \global\expandafter\let\expandafter\LN@Pfirst
      \csname #1LN@Pfirst\endcsname
   \expandafter\ifx\csname c@linenumber\endcsname\relax
      \newcount\c@linenumber
   \fi
   \expandafter\ifx\csname c@linenumber\endcsname\relax
      \newcount\c@linenumber
   \fi
   \c@linenumber #2\relax
   \testNumberedPage
   \expandafter\global\expandafter\let
      \csname #1NumberedPageCache\endcsname\NumberedPageCache
   \global\let\NumberedPageCache\@saved@NumberedPageCache
   \global\let\LN@Pfirst\@saved@LN@Pfirst
   \thelinenumber}}
\def\XR@[#1]#2{{%
  \makeatletter
  \def\@LN@column{1}%
  \def\XR@prefix{#1}%
  \@namedef{\XR@prefix LastNumberedPage}{first}%
  \@namedef{\XR@prefix LN@Pfirst}{\nextLN\relax}%
  \global\expandafter\edef
     \csname \XR@prefix NumberedPageCache\endcsname{%
        \expandafter\noexpand\csname \XR@prefix LN@Pfirst\endcsname}%
  \XR@next#2.aux\relax\\}}
\long\def\XR@test#1#2#3#4\XR@{%
  \ifx#1\newlabel
    \expandafter\expandafter\expandafter\ifx
       \expandafter\@car\@firstoftwo#3\relax\relax\@nil\getpagewiselinenumber
       \def\@tempa{\newlabel{\XR@prefix#2}}%
       \def\@tempb##1##2{%
          \edef\@tempb{{\noexpand\getpagewiselinenumber@XR{\XR@prefix}%
             \@gobble##1}}%
          \def\@tempc{{##2}}}%
       \@tempb#3\@empty\@empty
       \expandafter\expandafter\expandafter\@tempa
       \expandafter\expandafter\expandafter{\expandafter\@tempb\@tempc}%
    \else
       \newlabel{\XR@prefix#2}{#3}%
    \fi
  \else\ifx#1\@input
     \edef\XR@list{\XR@list#2\relax}%
  \else\ifx#1\@LN
     \@LN{#2}{#3}%
  \fi\fi\fi
  \ifeof\@inputcheck\expandafter\XR@aux
  \else\expandafter\XR@read\fi}
\makeatother
\externaldocument[main:]{main}%%% オプション引数は必要
%%% （そうしないと，sub.tex 自身での行番号の処理に干渉）
\newcommand{\refPL}[1]{P\pageref{main:page:#1}L\ref{main:line:#1}}
\begin{document}
文書間参照01：\refPL{01}\linelabel{sub:01}，
文書間参照02：\refPL{02}，
文書間参照03：\refPL{03}．
文書内参照P\pageref{sub:01}L\ref{sub:01}
\end{document}
